aboutsummaryrefslogtreecommitdiff
path: root/juick-common/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-05 01:38:04 +0300
committerGravatar Vitaly Takmazov2018-10-05 01:38:04 +0300
commitfe761771ce3cb65b00dc3a826c51b9f20ff6c72d (patch)
tree7671e1bd31dfc10f10d1110048efc313762c6dfe /juick-common/src
parenta6824b011325df07caf284352f09c2b9f76155c7 (diff)
TopEvent: Announce in Fediverse, like in XMPP/Telegram
Diffstat (limited to 'juick-common/src')
-rw-r--r--juick-common/src/main/java/com/juick/service/component/NotificationListener.java3
-rw-r--r--juick-common/src/main/java/com/juick/service/component/TopEvent.java21
2 files changed, 24 insertions, 0 deletions
diff --git a/juick-common/src/main/java/com/juick/service/component/NotificationListener.java b/juick-common/src/main/java/com/juick/service/component/NotificationListener.java
index 8092e258..38d0490a 100644
--- a/juick-common/src/main/java/com/juick/service/component/NotificationListener.java
+++ b/juick-common/src/main/java/com/juick/service/component/NotificationListener.java
@@ -19,4 +19,7 @@ public interface NotificationListener {
@Async
@EventListener
void processMessageReadEvent(MessageReadEvent messageReadEvent);
+ @Async
+ @EventListener
+ void processTopEvent(TopEvent topEvent);
}
diff --git a/juick-common/src/main/java/com/juick/service/component/TopEvent.java b/juick-common/src/main/java/com/juick/service/component/TopEvent.java
new file mode 100644
index 00000000..b7e24957
--- /dev/null
+++ b/juick-common/src/main/java/com/juick/service/component/TopEvent.java
@@ -0,0 +1,21 @@
+package com.juick.service.component;
+
+import com.juick.Message;
+import org.springframework.context.ApplicationEvent;
+
+public class TopEvent extends ApplicationEvent {
+ private Message message;
+ /**
+ * Create a new ApplicationEvent.
+ *
+ * @param source the object on which the event initially occurred (never {@code null})
+ */
+ public TopEvent(Object source, Message message) {
+ super(source);
+ this.message = message;
+ }
+
+ public Message getMessage() {
+ return message;
+ }
+}