diff options
author | 2018-10-10 00:09:58 +0300 | |
---|---|---|
committer | 2018-10-24 00:00:46 +0300 | |
commit | 8e6d764d6bb4391532e5376c795f634ee3898872 (patch) | |
tree | 99c5266ff0e1395b99ac5a70d2eca1e97865c856 /juick-server/src/main/java/com/juick/server/api/activity/model/Context.java | |
parent | ee62ef1659604a373cb1c94d3cf0b1a6fd3946e8 (diff) |
ActivityPub: Mentions and Hashtags
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/api/activity/model/Context.java')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/activity/model/Context.java | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Context.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Context.java index 0c47ef73..dd67fa64 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/model/Context.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Context.java @@ -5,9 +5,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.juick.server.api.activity.model.activities.*; +import com.juick.server.api.activity.model.objects.*; import java.time.Instant; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) @@ -36,12 +39,16 @@ public abstract class Context { private String id; + private String name; + private Instant published; private String url; private List<String> to; + private List<Context> tags; + public String getId() { return id; } @@ -81,7 +88,8 @@ public abstract class Context { } public static Context build(Context response) { - response.context = Arrays.asList(ACTIVITY_STREAMS_URI, SECURITY_URI); + response.context = new ArrayList(Arrays.asList(ACTIVITY_STREAMS_URI, SECURITY_URI)); + response.context.add(Collections.singletonMap("Hashtag", "as:Hashtag")); return response; } @@ -92,4 +100,21 @@ public abstract class Context { public void setUrl(String url) { this.url = url; } + + @JsonProperty("tag") + public List<Context> getTags() { + return tags; + } + + public void setTags(List<Context> tags) { + this.tags = tags; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } } |