aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-06-18 14:37:03 +0300
committerGravatar Vitaly Takmazov2019-06-18 14:37:03 +0300
commitea8d7674e7ed751cc8cd3abffc37ba2b96a4c569 (patch)
tree4e338763e0941f7278513b7a3b0dde1e5d0c17be /src/main/java
parent5920ea25d350ffac9ab318aec5b068a2a54d8ba8 (diff)
ActivityPub: top Announces should be public
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/juick/server/ActivityPubManager.java3
-rw-r--r--src/main/java/com/juick/server/api/activity/model/Context.java1
2 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/com/juick/server/ActivityPubManager.java b/src/main/java/com/juick/server/ActivityPubManager.java
index a5398325..94a8434e 100644
--- a/src/main/java/com/juick/server/ActivityPubManager.java
+++ b/src/main/java/com/juick/server/ActivityPubManager.java
@@ -266,7 +266,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene
if (MessageUtils.isPM(msg)) {
note.setTo(Collections.singletonList(personUri(msg.getTo())));
} else {
- note.setTo(Collections.singletonList("https://www.w3.org/ns/activitystreams#Public"));
+ note.setTo(Collections.singletonList(Context.ACTIVITYSTREAMS_PUBLIC));
note.setCc(Collections.singletonList(followersUri(msg.getUser())));
}
note.setPublished(msg.getCreated());
@@ -355,6 +355,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene
Announce announce = new Announce();
announce.setId(note.getId() + "#top");
announce.setActor(personUri(serviceUser));
+ announce.setTo(Collections.singletonList(Context.ACTIVITYSTREAMS_PUBLIC));
announce.setObject(note);
Person me = (Person) signatureManager.getContext(URI.create(announce.getActor())).get();
socialService.getFollowers(serviceUser).forEach(acct -> {
diff --git a/src/main/java/com/juick/server/api/activity/model/Context.java b/src/main/java/com/juick/server/api/activity/model/Context.java
index 1d3f238c..87e04a89 100644
--- a/src/main/java/com/juick/server/api/activity/model/Context.java
+++ b/src/main/java/com/juick/server/api/activity/model/Context.java
@@ -75,6 +75,7 @@ public abstract class Context {
public final static String LD_JSON_MEDIA_TYPE = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"";
public final static String ACTIVITY_MEDIA_TYPE = "application/activity+json";
public final static String ACTIVITYSTREAMS_PROFILE_MEDIA_TYPE = ACTIVITY_MEDIA_TYPE + "; profile=\"https://www.w3.org/ns/activitystreams\"";
+ public final static String ACTIVITYSTREAMS_PUBLIC = "https://www.w3.org/ns/activitystreams#Public";
public Instant getPublished() {
return published;