diff options
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/EmailManager.java')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/EmailManager.java | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/juick-server/src/main/java/com/juick/server/EmailManager.java b/juick-server/src/main/java/com/juick/server/EmailManager.java index 2be21127..534de35b 100644 --- a/juick-server/src/main/java/com/juick/server/EmailManager.java +++ b/juick-server/src/main/java/com/juick/server/EmailManager.java @@ -2,15 +2,14 @@ package com.juick.server; import com.juick.Message; import com.juick.User; -import com.juick.service.component.MessageEvent; import com.juick.service.EmailService; import com.juick.service.MessagesService; 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.context.ApplicationListener; import org.springframework.stereotype.Component; import javax.annotation.Nonnull; @@ -32,7 +31,7 @@ import static com.juick.formatters.PlainTextFormatter.formatPost; import static com.juick.formatters.PlainTextFormatter.formatUrl; @Component -public class EmailManager implements ApplicationListener<MessageEvent> { +public class EmailManager implements NotificationListener { public static final String MSGID_PATTERN = "\\.|@|<"; @@ -44,7 +43,7 @@ public class EmailManager implements ApplicationListener<MessageEvent> { @Inject private UserService userService; @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()) { @@ -69,6 +68,26 @@ public class EmailManager 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 emailNotify(String email, String subject, Message msg) { Map<String, String> headers = new HashMap<>(); if (!MessageUtils.isPM(msg)) { |