From a7bd0c5cd2330a84667b9762b4fd2cb35b1c20d4 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 10 Sep 2018 23:37:15 +0300 Subject: fix ActivityPub context --- .../java/com/juick/server/api/activity/model/ActivityObject.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'juick-server/src/main/java/com/juick/server/api/activity/model') diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java b/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java index 84a3e018..fceb3612 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java @@ -9,6 +9,8 @@ import java.util.List; public abstract class ActivityObject { + private List context; + private String id; private Instant published; @@ -27,7 +29,7 @@ public abstract class ActivityObject { @JsonProperty("@context") public List getContext() { - return Arrays.asList(ACTIVITY_STREAMS_URI, SECURITY_URI); + return context; } public final static String ACTIVITY_STREAMS_URI = "https://www.w3.org/ns/activitystreams"; @@ -42,4 +44,9 @@ public abstract class ActivityObject { public void setPublished(Instant published) { this.published = published; } + + public static ActivityObject build(ActivityObject response) { + response.context = Arrays.asList(ACTIVITY_STREAMS_URI, SECURITY_URI); + return response; + } } -- cgit v1.2.3