From 49cd7b074e8fa875b060668b0192a9cc35bac140 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 1 Feb 2019 09:50:24 +0300 Subject: SSE: own messages --- src/main/java/com/juick/server/ServerManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/com/juick/server/ServerManager.java b/src/main/java/com/juick/server/ServerManager.java index 4ea290fc..46faf9eb 100644 --- a/src/main/java/com/juick/server/ServerManager.java +++ b/src/main/java/com/juick/server/ServerManager.java @@ -25,6 +25,7 @@ import com.juick.service.SubscriptionService; import com.juick.service.UserService; import com.juick.service.component.*; import com.juick.util.MessageUtils; +import org.apache.commons.collections4.ListUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -70,7 +71,7 @@ public class ServerManager implements NotificationListener { private void onJuickPM(final User to, final com.juick.Message jmsg) { - messageEvent(jmsg, Collections.singletonList(to)); + messageEvent(jmsg, Arrays.asList(to, jmsg.getUser())); } private void onJuickMessagePost(final com.juick.Message jmsg, List subscribedUsers) { @@ -86,7 +87,7 @@ public class ServerManager implements NotificationListener { @Override public void processMessageEvent(MessageEvent event) { com.juick.Message jmsg = event.getMessage(); - List subscribedUsers = event.getUsers(); + List subscribedUsers = ListUtils.union(event.getUsers(), Collections.singletonList(jmsg.getUser())); if (jmsg.isService()) { readEvent(jmsg, Collections.singletonList(serviceUser)); return; -- cgit v1.2.3