diff options
author | 2018-11-03 13:14:15 +0300 | |
---|---|---|
committer | 2018-11-03 13:14:15 +0300 | |
commit | 2a64e080a395170875d62d3bebaf4dce3815bb13 (patch) | |
tree | e9c34caf2a694899ea67ab13d6bb2e0c20bee20d /juick-server/src/main/java/com/juick/server/ActivityPubManager.java | |
parent | 5cf3c20ed4463c6f35d51fc4e10366fe2b850f29 (diff) |
ActivityPub: mentions with @user@server.tld
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/ActivityPubManager.java')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/ActivityPubManager.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/ActivityPubManager.java b/juick-server/src/main/java/com/juick/server/ActivityPubManager.java index 0cb76a03..6f5163cc 100644 --- a/juick-server/src/main/java/com/juick/server/ActivityPubManager.java +++ b/juick-server/src/main/java/com/juick/server/ActivityPubManager.java @@ -262,6 +262,15 @@ public class ActivityPubManager implements ActivityListener, NotificationListene } else if (MessageUtils.isReply(msg)) { note.getTags().add(new Mention(personWebUri(msg.getTo()), msg.getTo().getName())); } + MessageUtils.getGlobalMentions(msg).forEach(m -> { + // @user@server.tld -> user@server.tld + Optional<Context> personContext = signatureManager.discoverPerson(m.substring(1)); + if (personContext.isPresent()) { + Person person = (Person) personContext.get(); + note.getTags().add(new Mention(person.getUrl(), person.getPreferredUsername())); + note.getCc().add(person.getUrl()); + } + }); if (msg.isHtml()) { note.setContent(msg.getText()); } else { |