aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick')
-rw-r--r--src/main/java/com/juick/ActivityPubManager.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/com/juick/ActivityPubManager.java b/src/main/java/com/juick/ActivityPubManager.java
index 5b0e8d59..c6f2c3d8 100644
--- a/src/main/java/com/juick/ActivityPubManager.java
+++ b/src/main/java/com/juick/ActivityPubManager.java
@@ -213,9 +213,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene
if (type.equals(ActivityType.message)) {
processMessage(systemEvent.getActivity().getMessage());
} else if (type.equals(ActivityType.like)) {
- if (systemEvent.getActivity().getFrom().equals(serviceUser)) {
- processTop(systemEvent.getActivity().getMessage());
- }
+ processLike(systemEvent.getActivity().getFrom(), systemEvent.getActivity().getMessage());
}
}
@@ -403,15 +401,15 @@ public class ActivityPubManager implements ActivityListener, NotificationListene
}
- private void processTop(Message message) {
+ private void processLike(User user, Message message) {
Note note = makeNote(message);
Announce announce = new Announce();
announce.setId(note.getId() + "#top");
- announce.setActor(personUri(serviceUser));
+ announce.setActor(personUri(user));
announce.setTo(Collections.singletonList(Context.ACTIVITYSTREAMS_PUBLIC));
announce.setObject(note);
Actor me = (Actor) signatureManager.getContext(URI.create(announce.getActor())).get();
- socialService.getFollowers(serviceUser).forEach(acct -> {
+ socialService.getFollowers(user).forEach(acct -> {
var follower = signatureManager.getContext(URI.create(acct));
follower.ifPresentOrElse((person) -> {
try {