aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/api/activity/model
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/api/activity/model')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/Context.java27
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/objects/Hashtag.java6
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/objects/Image.java (renamed from juick-server/src/main/java/com/juick/server/api/activity/model/Image.java)4
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/objects/Key.java (renamed from juick-server/src/main/java/com/juick/server/api/activity/model/Key.java)4
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/objects/Link.java (renamed from juick-server/src/main/java/com/juick/server/api/activity/model/Link.java)4
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/objects/Mention.java8
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/objects/Note.java (renamed from juick-server/src/main/java/com/juick/server/api/activity/model/Note.java)4
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/objects/OrderedCollection.java (renamed from juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollection.java)4
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/objects/OrderedCollectionPage.java (renamed from juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollectionPage.java)4
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/objects/Person.java (renamed from juick-server/src/main/java/com/juick/server/api/activity/model/Person.java)3
10 files changed, 60 insertions, 8 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;
+ }
}
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Hashtag.java b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Hashtag.java
new file mode 100644
index 00000000..34e73be6
--- /dev/null
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Hashtag.java
@@ -0,0 +1,6 @@
+package com.juick.server.api.activity.model.objects;
+
+import com.juick.server.api.activity.model.Context;
+
+public class Hashtag extends Context {
+}
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Image.java b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Image.java
index 07d6ff99..e067f729 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/model/Image.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Image.java
@@ -1,4 +1,6 @@
-package com.juick.server.api.activity.model;
+package com.juick.server.api.activity.model.objects;
+
+import com.juick.server.api.activity.model.Context;
public class Image extends Context {
private String mediaType;
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Key.java b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Key.java
index bc41b460..075c51dd 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/model/Key.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Key.java
@@ -1,4 +1,6 @@
-package com.juick.server.api.activity.model;
+package com.juick.server.api.activity.model.objects;
+
+import com.juick.server.api.activity.model.Context;
public class Key extends Context {
private String owner;
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Link.java b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Link.java
index 543b5f0c..0c4f26dc 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/model/Link.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Link.java
@@ -1,4 +1,6 @@
-package com.juick.server.api.activity.model;
+package com.juick.server.api.activity.model.objects;
+
+import com.juick.server.api.activity.model.Context;
public class Link extends Context {
private String href;
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Mention.java b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Mention.java
new file mode 100644
index 00000000..dbf3bec9
--- /dev/null
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Mention.java
@@ -0,0 +1,8 @@
+package com.juick.server.api.activity.model.objects;
+
+public class Mention extends Link {
+ public Mention(String href, String name) {
+ this.setHref(href);
+ this.setName(name);
+ }
+}
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Note.java b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Note.java
index 83ef36dd..458b925c 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/model/Note.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Note.java
@@ -1,4 +1,6 @@
-package com.juick.server.api.activity.model;
+package com.juick.server.api.activity.model.objects;
+
+import com.juick.server.api.activity.model.Context;
import java.util.List;
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollection.java b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/OrderedCollection.java
index d66c55be..426cf331 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollection.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/OrderedCollection.java
@@ -1,4 +1,6 @@
-package com.juick.server.api.activity.model;
+package com.juick.server.api.activity.model.objects;
+
+import com.juick.server.api.activity.model.Context;
public class OrderedCollection extends Context {
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollectionPage.java b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/OrderedCollectionPage.java
index bcae87d0..601919ba 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollectionPage.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/OrderedCollectionPage.java
@@ -1,4 +1,6 @@
-package com.juick.server.api.activity.model;
+package com.juick.server.api.activity.model.objects;
+
+import com.juick.server.api.activity.model.Context;
import java.util.List;
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Person.java
index 00006d4f..2d3a45d7 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/objects/Person.java
@@ -1,6 +1,7 @@
-package com.juick.server.api.activity.model;
+package com.juick.server.api.activity.model.objects;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.juick.server.api.activity.model.Context;
public class Person extends Context {