diff options
author | 2018-05-10 12:50:08 +0300 | |
---|---|---|
committer | 2018-05-10 12:50:08 +0300 | |
commit | fb540605626e1c7bb1544a518a254e6a820afcb3 (patch) | |
tree | b370df3f031a1a72a34b64bc197cd600b6947f5d /juick-server/src/main/java/com/juick/server/MessengerManager.java | |
parent | d2a1f21717c8583c9804c69319123fb7ebaac261 (diff) |
server: MessageReadEvent
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.java | 12 |
1 files changed, 5 insertions, 7 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 323eef7c..51bbb3e2 100644 --- a/juick-server/src/main/java/com/juick/server/MessengerManager.java +++ b/juick-server/src/main/java/com/juick/server/MessengerManager.java @@ -19,6 +19,7 @@ import com.juick.service.MessagesService; import com.juick.service.MessengerService; import com.juick.service.SubscriptionService; import com.juick.service.UserService; +import com.juick.util.MessageUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -111,13 +112,10 @@ public class MessengerManager implements ApplicationListener<MessageEvent> { public void onApplicationEvent(@Nonnull MessageEvent event) { Message msg = event.getMessage(); List<User> subscribedUsers = event.getUsers(); - if (msg.getMid() > 0 && msg.getRid() == 0) { - String subject = formatPost(msg); - subscribedUsers - .forEach(user -> messengerService.getSenderId(user) - .ifPresent(t -> messengerNotify(t, subject, formatUrl(msg)))); - } else if (msg.getRid() > 0) { - Message op = messagesService.getMessage(msg.getMid()); + if (msg.isService()) { + return; + } + if (!MessageUtils.isPM(msg)) { String subject = formatPost(msg); subscribedUsers .forEach(user -> messengerService.getSenderId(user) |