aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/api
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-08-20 11:25:44 +0300
committerGravatar Vitaly Takmazov2021-08-20 11:25:44 +0300
commitbab10770a77f5f756a58c4ca6f19dd51e1b492ee (patch)
tree5461c0ad688c862f48adead0ee34a46d935d159a /src/main/java/com/juick/www/api
parentd24b3d5ab3d0c3b42f878658fa76aeaeaca4c5a1 (diff)
map NSFW tag to as:sensitive ActivityPub property
Diffstat (limited to 'src/main/java/com/juick/www/api')
-rw-r--r--src/main/java/com/juick/www/api/activity/model/Context.java1
-rw-r--r--src/main/java/com/juick/www/api/activity/model/objects/Note.java11
2 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/com/juick/www/api/activity/model/Context.java b/src/main/java/com/juick/www/api/activity/model/Context.java
index f41aa69c..e75f2440 100644
--- a/src/main/java/com/juick/www/api/activity/model/Context.java
+++ b/src/main/java/com/juick/www/api/activity/model/Context.java
@@ -115,6 +115,7 @@ public abstract class Context {
public static Context build(Context response) {
response.context = new ArrayList<>(Arrays.asList(ACTIVITY_STREAMS_URI, SECURITY_URI));
response.context.add(Collections.singletonMap("Hashtag", "as:Hashtag"));
+ response.context.add(Collections.singletonMap("sensitive", "as:sensitive"));
return response;
}
diff --git a/src/main/java/com/juick/www/api/activity/model/objects/Note.java b/src/main/java/com/juick/www/api/activity/model/objects/Note.java
index 8aa196a3..66470b5c 100644
--- a/src/main/java/com/juick/www/api/activity/model/objects/Note.java
+++ b/src/main/java/com/juick/www/api/activity/model/objects/Note.java
@@ -29,11 +29,12 @@ public class Note extends Context {
private List<Image> attachment;
private List<String> to;
private List<String> cc;
+ private boolean sensitive;
public String getContent() {
return content;
}
-
+
public void setContent(String content) {
this.content = content;
}
@@ -78,4 +79,12 @@ public class Note extends Context {
public void setInReplyTo(String inReplyTo) {
this.inReplyTo = inReplyTo;
}
+
+ public boolean isSensitive() {
+ return sensitive;
+ }
+
+ public void setSensitive(boolean sensitive) {
+ this.sensitive = sensitive;
+ }
}