From b09dac438ad29903a79916d20c90e1a2154fabf6 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 30 Jan 2019 09:16:22 +0300 Subject: ActivityPub: cc to global mentions --- src/main/java/com/juick/server/ActivityPubManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/com/juick/server/ActivityPubManager.java b/src/main/java/com/juick/server/ActivityPubManager.java index 5249f3c9..24cc2123 100644 --- a/src/main/java/com/juick/server/ActivityPubManager.java +++ b/src/main/java/com/juick/server/ActivityPubManager.java @@ -182,9 +182,10 @@ public class ActivityPubManager implements ActivityListener, NotificationListene cc.add(replier); note.setCc(cc); } + subscribers.addAll(note.getCc()); subscribers.forEach(acct -> { Optional context = signatureManager.getContext(URI.create(acct)); - if (context.isPresent()) { + if (context.isPresent() && context.get() instanceof Person) { Person follower = (Person)context.get(); Create create = new Create(); create.setId(note.getId()); @@ -304,7 +305,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene Person person = (Person) personContext.get(); note.getTags().add(new Mention(person.getUrl(), person.getPreferredUsername())); List cc = new ArrayList<>(note.getCc()); - cc.add(person.getUrl()); + cc.add(person.getId()); note.setCc(cc); } }); -- cgit v1.2.3