aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/api/Messages.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-04-18 13:36:37 +0300
committerGravatar Vitaly Takmazov2023-04-18 13:36:37 +0300
commit66801ba91a51c9b7df6d85136d677350d2495b86 (patch)
tree6ed5b2ee31b5bb3158ae1d3b791a6e284f438465 /src/main/java/com/juick/www/api/Messages.java
parent9e34dffdcdeac0057f1bbd36a3978b992f2c4790 (diff)
ActivityPub compatibility with private posts
Diffstat (limited to 'src/main/java/com/juick/www/api/Messages.java')
-rw-r--r--src/main/java/com/juick/www/api/Messages.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/com/juick/www/api/Messages.java b/src/main/java/com/juick/www/api/Messages.java
index f059aa88..d127d166 100644
--- a/src/main/java/com/juick/www/api/Messages.java
+++ b/src/main/java/com/juick/www/api/Messages.java
@@ -20,6 +20,7 @@ package com.juick.www.api;
import com.juick.model.Message;
import com.juick.model.Tag;
import com.juick.model.User;
+import com.juick.service.activities.UpdateEvent;
import com.juick.util.WebUtils;
import com.juick.www.WebApp;
import com.juick.model.CommandResult;
@@ -208,6 +209,9 @@ public class Messages {
if (visitor.isPremium() || userService.isAdminUser(visitor)) {
var msg = messagesService.getMessage(mid).orElseThrow(HttpNotFoundException::new);
messagesService.setFriendsOnly(mid, !msg.FriendsOnly);
+ msg = messagesService.getMessage(mid).orElseThrow(HttpNotFoundException::new);
+ applicationEventPublisher.publishEvent(
+ new UpdateEvent(this, visitor, msg));
} else {
throw new HttpBadRequestException();
}