diff options
author | Vitaly Takmazov | 2018-10-04 14:18:53 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-10-04 14:18:53 +0300 |
commit | 051fd4608ebd30e94eb847906571f5f221d3e952 (patch) | |
tree | 23b4e51a768dfb4ae2dd1b767fece49f1817cabf /juick-server/src/main/java/com/juick/server | |
parent | 873fbbc8b7f59c68c6bf37ff9af79c8fb2aef8ed (diff) |
Undo object deserialized as Map
Diffstat (limited to 'juick-server/src/main/java/com/juick/server')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/ActivityPubManager.java | 3 | ||||
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/activity/Profile.java | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/juick-server/src/main/java/com/juick/server/ActivityPubManager.java b/juick-server/src/main/java/com/juick/server/ActivityPubManager.java index 17522423..e0bbdb85 100644 --- a/juick-server/src/main/java/com/juick/server/ActivityPubManager.java +++ b/juick-server/src/main/java/com/juick/server/ActivityPubManager.java @@ -17,7 +17,6 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.ApplicationListener; import org.springframework.stereotype.Component; import org.springframework.web.util.UriComponentsBuilder; @@ -72,7 +71,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene @Override public void undoFollowEvent(UndoFollowEvent event) { String actor = event.getActor(); - String me = (String)event.getFollowRequest().getObject(); + String me = event.getObject(); logger.info("{} stopping to follow {}", actor, me); User followedUser = socialService.getUserByAccountUri(me); if (!followedUser.isAnonymous()) { diff --git a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java index 2e089330..23cd74ce 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java @@ -240,8 +240,8 @@ public class Profile { return new ResponseEntity<>(HttpStatus.UNAUTHORIZED); } if (activity instanceof Undo) { - Follow undoFollow = (Follow) ((Undo) activity).getObject(); - applicationEventPublisher.publishEvent(new UndoFollowEvent(this, ((Undo) activity).getActor(), undoFollow)); + String follower = (String)((Map) ((Undo) activity).getObject()).get("object"); + applicationEventPublisher.publishEvent(new UndoFollowEvent(this, ((Undo) activity).getActor(), follower)); return new ResponseEntity<>(HttpStatus.OK); } return new ResponseEntity<>(HttpStatus.BAD_REQUEST); |