aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/juick/server/ActivityPubManager.java7
-rw-r--r--src/main/java/com/juick/server/api/activity/model/objects/Hashtag.java9
2 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/com/juick/server/ActivityPubManager.java b/src/main/java/com/juick/server/ActivityPubManager.java
index 38a853b4..c40bbb5c 100644
--- a/src/main/java/com/juick/server/ActivityPubManager.java
+++ b/src/main/java/com/juick/server/ActivityPubManager.java
@@ -276,12 +276,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene
attachment.setMediaType(HttpUtils.mediaType(msg.getAttachmentType()));
note.setAttachment(Collections.singletonList(attachment));
}
- note.setTags(msg.getTags().stream().map(t -> {
- Hashtag hashtag = new Hashtag();
- hashtag.setId(tagUri(t));
- hashtag.setName(t.getName());
- return hashtag;
- }).collect(Collectors.toList()));
+ note.setTags(msg.getTags().stream().map(t -> new Hashtag(tagUri(t), t.getName())).collect(Collectors.toList()));
if (msg.getReplyToUri() != null && msg.getReplyToUri().toASCIIString().length() > 0) {
Optional<Context> noteContext = signatureManager.getContext(msg.getReplyToUri());
if (noteContext.isPresent()) {
diff --git a/src/main/java/com/juick/server/api/activity/model/objects/Hashtag.java b/src/main/java/com/juick/server/api/activity/model/objects/Hashtag.java
index 34e73be6..46ad424e 100644
--- a/src/main/java/com/juick/server/api/activity/model/objects/Hashtag.java
+++ b/src/main/java/com/juick/server/api/activity/model/objects/Hashtag.java
@@ -1,6 +1,11 @@
package com.juick.server.api.activity.model.objects;
-import com.juick.server.api.activity.model.Context;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
-public class Hashtag extends Context {
+public class Hashtag extends Mention {
+ @JsonCreator
+ public Hashtag(@JsonProperty("href") String href, @JsonProperty("name") String name) {
+ super(href, name);
+ }
}