diff options
author | 2019-03-16 23:56:27 +0300 | |
---|---|---|
committer | 2019-03-16 23:56:27 +0300 | |
commit | 06105f76dbfa3b65e63ed06f9c4d5107bd49ed88 (patch) | |
tree | 5702c01cec9688039d891f4a711878706101c1c5 /src/main/java/com/juick/server/ActivityPubManager.java | |
parent | 3ea4cd1942fa4e763034da11c5fa429407b67829 (diff) | |
parent | a49105285d0d7719d7f222a507af2d5ac5b4bdb1 (diff) |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/main/java/com/juick/server/ActivityPubManager.java')
-rw-r--r-- | src/main/java/com/juick/server/ActivityPubManager.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/juick/server/ActivityPubManager.java b/src/main/java/com/juick/server/ActivityPubManager.java index 5249f3c9..a5398325 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()); @@ -268,7 +269,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene note.setTo(Collections.singletonList("https://www.w3.org/ns/activitystreams#Public")); note.setCc(Collections.singletonList(followersUri(msg.getUser()))); } - note.setPublished(msg.getTimestamp()); + note.setPublished(msg.getCreated()); if (StringUtils.isNotBlank(msg.getAttachmentType())) { Image attachment = new Image(); attachment.setId(msg.getAttachment().getMedium().getUrl()); @@ -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); } }); |