aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/MessengerManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/MessengerManager.java')
-rw-r--r--juick-server/src/main/java/com/juick/server/MessengerManager.java27
1 files changed, 23 insertions, 4 deletions
diff --git a/juick-server/src/main/java/com/juick/server/MessengerManager.java b/juick-server/src/main/java/com/juick/server/MessengerManager.java
index 1283d8b2..90c58f03 100644
--- a/juick-server/src/main/java/com/juick/server/MessengerManager.java
+++ b/juick-server/src/main/java/com/juick/server/MessengerManager.java
@@ -17,17 +17,16 @@ import com.github.messenger4j.userprofile.UserProfile;
import com.github.messenger4j.webhook.event.TextMessageEvent;
import com.juick.Message;
import com.juick.User;
-import com.juick.service.component.MessageEvent;
import com.juick.model.AnonymousUser;
import com.juick.service.MessagesService;
import com.juick.service.MessengerService;
import com.juick.service.UserService;
+import com.juick.service.component.*;
import com.juick.util.MessageUtils;
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 javax.annotation.Nonnull;
@@ -45,7 +44,7 @@ import static com.juick.formatters.PlainTextFormatter.formatPost;
import static com.juick.formatters.PlainTextFormatter.formatUrl;
@Component
-public class MessengerManager implements ApplicationListener<MessageEvent> {
+public class MessengerManager implements NotificationListener {
private static final Logger logger = LoggerFactory.getLogger(MessengerManager.class);
@Inject
private MessagesService messagesService;
@@ -112,7 +111,7 @@ public class MessengerManager implements ApplicationListener<MessageEvent> {
}
@Override
- public void onApplicationEvent(@Nonnull MessageEvent event) {
+ public void processMessageEvent(@Nonnull MessageEvent event) {
Message msg = event.getMessage();
List<User> subscribedUsers = event.getUsers();
if (msg.isService()) {
@@ -126,6 +125,26 @@ public class MessengerManager implements ApplicationListener<MessageEvent> {
}
}
+ @Override
+ public void processSubscribeEvent(SubscribeEvent subscribeEvent) {
+
+ }
+
+ @Override
+ public void processLikeEvent(LikeEvent likeEvent) {
+
+ }
+
+ @Override
+ public void processPingEvent(PingEvent pingEvent) {
+
+ }
+
+ @Override
+ public void processMessageReadEvent(MessageReadEvent messageReadEvent) {
+
+ }
+
private void messengerNotify(String messengerUser, String text, String url) {
try {
if (!StringUtils.isEmpty(url)) {