diff options
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) |