aboutsummaryrefslogtreecommitdiff
path: root/juick-ws
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-01-31 02:34:09 +0300
committerGravatar Vitaly Takmazov2018-01-31 02:34:09 +0300
commit47af4cca11a4a26b73a7f5eeb0a82fcae3145afc (patch)
tree6b0e84d339b967006873e98aea59b25dbf50209a /juick-ws
parent86449c7a60a3f39e400ec98a8f8b9e3c6804f41e (diff)
ws: send messages to authenticated services
Diffstat (limited to 'juick-ws')
-rw-r--r--juick-ws/src/main/java/com/juick/ws/XMPPConnection.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java
index be7f3899..e338bf66 100644
--- a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java
+++ b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java
@@ -162,6 +162,7 @@ public class XMPPConnection implements AutoCloseable {
synchronized (wsHandler.getClients()) {
wsHandler.getClients().stream().filter(c ->
(!c.legacy && c.visitor.getUid() == 0) // anonymous users
+ || c.visitor.getName().equals(serviceUser) // services
|| (!c.legacy && uids.contains(c.visitor.getUid()))) // subscriptions
.forEach(c -> {
try {
@@ -192,6 +193,7 @@ public class XMPPConnection implements AutoCloseable {
synchronized (wsHandler.getClients()) {
wsHandler.getClients().stream().filter(c ->
(!c.legacy && c.visitor.getUid() == 0) // anonymous users
+ || c.visitor.getName().equals(serviceUser) // services
|| (!c.legacy && threadUsers.contains(c.visitor.getUid()))) // subscriptions
.forEach(c -> {
try {