aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/service/activities
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-04 13:59:28 +0300
committerGravatar Vitaly Takmazov2018-10-04 14:01:56 +0300
commit873fbbc8b7f59c68c6bf37ff9af79c8fb2aef8ed (patch)
tree86684ced187edc819acb6a8132047342553d3d76 /juick-server/src/main/java/com/juick/service/activities
parentfdc329f367e5685cc9d4b0654f53eaa03818e905 (diff)
ActivityPub: handle Undo following requests
Diffstat (limited to 'juick-server/src/main/java/com/juick/service/activities')
-rw-r--r--juick-server/src/main/java/com/juick/service/activities/ActivityListener.java10
-rw-r--r--juick-server/src/main/java/com/juick/service/activities/UndoFollowEvent.java27
2 files changed, 37 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/service/activities/ActivityListener.java b/juick-server/src/main/java/com/juick/service/activities/ActivityListener.java
new file mode 100644
index 00000000..f89b401d
--- /dev/null
+++ b/juick-server/src/main/java/com/juick/service/activities/ActivityListener.java
@@ -0,0 +1,10 @@
+package com.juick.service.activities;
+
+import org.springframework.context.event.EventListener;
+
+public interface ActivityListener {
+ @EventListener
+ void processFollowEvent(FollowEvent event);
+ @EventListener
+ void undoFollowEvent(UndoFollowEvent event);
+}
diff --git a/juick-server/src/main/java/com/juick/service/activities/UndoFollowEvent.java b/juick-server/src/main/java/com/juick/service/activities/UndoFollowEvent.java
new file mode 100644
index 00000000..fa162b2e
--- /dev/null
+++ b/juick-server/src/main/java/com/juick/service/activities/UndoFollowEvent.java
@@ -0,0 +1,27 @@
+package com.juick.service.activities;
+
+import com.juick.server.api.activity.model.activities.Follow;
+import org.springframework.context.ApplicationEvent;
+
+public class UndoFollowEvent extends ApplicationEvent {
+ private String actor;
+ private Follow followRequest;
+ /**
+ * Create a new ApplicationEvent.
+ *
+ * @param source the object on which the event initially occurred (never {@code null})
+ */
+ public UndoFollowEvent(Object source, String actor, Follow object) {
+ super(source);
+ this.actor = actor;
+ this.followRequest = object;
+ }
+
+ public String getActor() {
+ return actor;
+ }
+
+ public Follow getFollowRequest() {
+ return followRequest;
+ }
+}