aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-10-23 23:19:09 +0300
committerGravatar Vitaly Takmazov2021-10-23 23:19:09 +0300
commitb2fe8b2ce6e8c59b93e19b714d7dc30e4f2d9965 (patch)
tree8018331486eac58fcdde488927227a58dad259d8 /src/main
parent1f6514473be20ed134f2fc89315b72b2b8162375 (diff)
ActivityPub: handle unexpected Undo activity
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/juick/www/api/activity/Profile.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/com/juick/www/api/activity/Profile.java b/src/main/java/com/juick/www/api/activity/Profile.java
index 26e2717c..e6a4e789 100644
--- a/src/main/java/com/juick/www/api/activity/Profile.java
+++ b/src/main/java/com/juick/www/api/activity/Profile.java
@@ -300,15 +300,15 @@ public class Profile {
return new ResponseEntity<>(CommandResult.fromString("Follow request accepted"), HttpStatus.ACCEPTED);
}
if (activity instanceof Undo) {
- Activity object = (Activity) activity.getObject();
+ Context object = activity.getObject();
if (object instanceof Follow) {
applicationEventPublisher
- .publishEvent(new UndoFollowEvent(this, activity.getActor(), object.getObject().getId()));
+ .publishEvent(new UndoFollowEvent(this, activity.getActor(), ((Activity)object).getObject().getId()));
return new ResponseEntity<>(CommandResult.fromString("Undo follow request accepted"),
HttpStatus.OK);
} else if (object instanceof Like || object instanceof Announce) {
applicationEventPublisher
- .publishEvent(new UndoAnnounceEvent(this, activity.getActor(), object.getObject().getId()));
+ .publishEvent(new UndoAnnounceEvent(this, activity.getActor(), ((Activity)object).getObject().getId()));
return new ResponseEntity<>(CommandResult.fromString("Undo like/announce request accepted"),
HttpStatus.OK);
}