aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-01-30 09:16:22 +0300
committerGravatar Vitaly Takmazov2019-01-30 09:20:11 +0300
commitb09dac438ad29903a79916d20c90e1a2154fabf6 (patch)
tree84c715da068c1f2507a29fe45dd4e12a37b48703 /src/main
parentd60b38d9c9cf5bbcd7add6bf1a344a4ad4267bc8 (diff)
ActivityPub: cc to global mentions
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/juick/server/ActivityPubManager.java5
1 files changed, 3 insertions, 2 deletions
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> 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<String> cc = new ArrayList<>(note.getCc());
- cc.add(person.getUrl());
+ cc.add(person.getId());
note.setCc(cc);
}
});