Skip to content
Permalink
Browse files

#499 ActivityPub: Audience should be always present. Now "Favorite" a…

…ction works also.
  • Loading branch information...
yvolk committed Apr 3, 2019
1 parent 1c68f9f commit cb69cede791dc3b0afee2660020bfb6f14116b32
@@ -125,6 +125,8 @@ public void getTimeline() throws IOException {
assertEquals("Following", TriState.UNKNOWN, objActor.followedByMe);
assertEquals("Url of objActor", "https://pleroma.site/users/AndStatus", objActor.getProfileUrl());
assertEquals("WebFinger ID", "andstatus@pleroma.site", objActor.getWebFingerId());
assertEquals("Avatar", "https://pleroma.site/media/c5f60f06-6620-46b6-b676-f9f4571b518e/bfa1745b8c221225cc6551805d9eaa8bebe5f36fc1856b4924bcfda5d620334d.png",
objActor.getAvatarUrl());
}
}

@@ -184,8 +184,9 @@ private JSONObject newActivityOfThisAccount(ActivityType activityType) throws JS

private void setAudience(JSONObject activity, ActivityType activityType) throws JSONException {
audience.getActors().forEach(actor -> addToAudience(activity, "to", actor));
if (audience.isEmpty() && StringUtils.isEmpty(inReplyToId)
&& (activityType.equals(ActivityType.CREATE) || activityType.equals(ActivityType.UPDATE))) {
if (audience.isEmpty()) {
// "clients must be aware that the server will only forward new Activities
// to addressees in the to, bto, cc, bcc, and audience fields"
addToAudience(activity, "to", Actor.PUBLIC);
}
}

0 comments on commit cb69ced

Please sign in to comment.
You can’t perform that action at this time.