aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/ServerManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/ServerManager.java')
-rw-r--r--juick-server/src/main/java/com/juick/server/ServerManager.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/juick-server/src/main/java/com/juick/server/ServerManager.java b/juick-server/src/main/java/com/juick/server/ServerManager.java
index f5ca82f1..a4fd68ff 100644
--- a/juick-server/src/main/java/com/juick/server/ServerManager.java
+++ b/juick-server/src/main/java/com/juick/server/ServerManager.java
@@ -28,11 +28,9 @@ import com.juick.util.MessageUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import org.springframework.web.socket.TextMessage;
-import javax.annotation.Nonnull;
import javax.inject.Inject;
import java.io.IOException;
import java.util.List;
@@ -69,7 +67,7 @@ public class ServerManager implements NotificationListener {
.forEach(c -> {
try {
logger.debug("sending pm to {}", c.visitor.getUid());
- c.session.sendMessage(new TextMessage(json));
+ c.sendMessage(new TextMessage(json));
} catch (IOException e) {
logger.warn("ws error", e);
}
@@ -93,7 +91,7 @@ public class ServerManager implements NotificationListener {
.forEach(c -> {
try {
logger.debug("sending message to {}", c.visitor.getUid());
- c.session.sendMessage(new TextMessage(json));
+ c.sendMessage(new TextMessage(json));
} catch (IOException e) {
logger.warn("ws error", e);
}
@@ -103,7 +101,7 @@ public class ServerManager implements NotificationListener {
.forEach(c -> {
try {
logger.debug("sending message to legacy client {}", c.visitor.getUid());
- c.session.sendMessage(new TextMessage(json));
+ c.sendMessage(new TextMessage(json));
} catch (IOException e) {
logger.warn("ws error", e);
}
@@ -130,7 +128,7 @@ public class ServerManager implements NotificationListener {
.forEach(c -> {
try {
logger.debug("sending reply to {}", c.visitor.getUid());
- c.session.sendMessage(new TextMessage(json));
+ c.sendMessage(new TextMessage(json));
} catch (IOException e) {
logger.warn("ws error", e);
}
@@ -140,7 +138,7 @@ public class ServerManager implements NotificationListener {
.forEach(c -> {
try {
logger.debug("sending reply to legacy client {}", c.visitor.getUid());
- c.session.sendMessage(new TextMessage(json));
+ c.sendMessage(new TextMessage(json));
} catch (IOException e) {
logger.warn("ws error", e);
}
@@ -203,7 +201,7 @@ public class ServerManager implements NotificationListener {
serviceMessage.setMid(source.getMid());
serviceMessage.setUnread(false);
try {
- u.session.sendMessage(new TextMessage(jsonMapper.writeValueAsString(serviceMessage)));
+ u.sendMessage(new TextMessage(jsonMapper.writeValueAsString(serviceMessage)));
} catch (IOException e) {
logger.error("JSON error", e);
}