From 873fbbc8b7f59c68c6bf37ff9af79c8fb2aef8ed Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 4 Oct 2018 13:59:28 +0300 Subject: ActivityPub: handle Undo following requests --- juick-server/src/main/java/com/juick/server/api/activity/Profile.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'juick-server/src/main/java/com/juick/server/api') 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 7b854d52..2e089330 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 @@ -13,6 +13,7 @@ import com.juick.server.util.UserUtils; import com.juick.service.MessagesService; import com.juick.service.UserService; import com.juick.service.activities.FollowEvent; +import com.juick.service.activities.UndoFollowEvent; import com.juick.util.MessageUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; @@ -239,6 +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)); return new ResponseEntity<>(HttpStatus.OK); } return new ResponseEntity<>(HttpStatus.BAD_REQUEST); -- cgit v1.2.3