diff options
author | Vitaly Takmazov | 2019-02-01 09:50:24 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-02-01 09:50:24 +0300 |
commit | 49cd7b074e8fa875b060668b0192a9cc35bac140 (patch) | |
tree | cfa631e6cd77af2cacaf9628d7580b20928252e0 /src/main/java/com/juick/server/ServerManager.java | |
parent | a1693967fc7d75060cdc66da720168563a473fea (diff) |
SSE: own messages
Diffstat (limited to 'src/main/java/com/juick/server/ServerManager.java')
-rw-r--r-- | src/main/java/com/juick/server/ServerManager.java | 5 |
1 files changed, 3 insertions, 2 deletions
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<User> subscribedUsers) { @@ -86,7 +87,7 @@ public class ServerManager implements NotificationListener { @Override public void processMessageEvent(MessageEvent event) { com.juick.Message jmsg = event.getMessage(); - List<User> subscribedUsers = event.getUsers(); + List<User> subscribedUsers = ListUtils.union(event.getUsers(), Collections.singletonList(jmsg.getUser())); if (jmsg.isService()) { readEvent(jmsg, Collections.singletonList(serviceUser)); return; |