diff options
Diffstat (limited to 'src/main/java/com/juick/ActivityPubManager.java')
-rw-r--r-- | src/main/java/com/juick/ActivityPubManager.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/com/juick/ActivityPubManager.java b/src/main/java/com/juick/ActivityPubManager.java index 62faccf6..d5ee0b50 100644 --- a/src/main/java/com/juick/ActivityPubManager.java +++ b/src/main/java/com/juick/ActivityPubManager.java @@ -183,7 +183,6 @@ public class ActivityPubManager implements ActivityListener, NotificationListene update.setId(note.getId() + "#update"); update.setActor(me.getId()); update.setObject(note); - update.setTo(Collections.singletonList(Context.ACTIVITYSTREAMS_PUBLIC)); update.setPublished(Instant.now()); logger.info("{} sends note update to followers", me.getId()); activityToFollowers(user, me, update); @@ -313,8 +312,13 @@ public class ActivityPubManager implements ActivityListener, NotificationListene if (MessageUtils.isPM(msg)) { note.setTo(Collections.singletonList(profileUriBuilder.personUri(msg.getTo()))); } else { - note.setTo(Collections.singletonList(Context.ACTIVITYSTREAMS_PUBLIC)); - note.setCc(Collections.singletonList(profileUriBuilder.followersUri(msg.getUser()))); + var followers = Collections.singletonList(profileUriBuilder.followersUri(msg.getUser())); + if (!msg.FriendsOnly) { + note.setTo(Collections.singletonList(Context.ACTIVITYSTREAMS_PUBLIC)); + note.setCc(followers); + } else { + note.setTo(followers); + } } note.setPublished(msg.getCreated()); if (StringUtils.isNotBlank(msg.getAttachmentType())) { |