diff options
Diffstat (limited to 'juick-ws/src/main/java/com/juick/ws/XMPPConnection.java')
-rw-r--r-- | juick-ws/src/main/java/com/juick/ws/XMPPConnection.java | 36 |
1 files changed, 18 insertions, 18 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 04ea5378..7a6feee1 100644 --- a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java +++ b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java @@ -100,7 +100,7 @@ public class XMPPConnection implements InitializingBean, DisposableBean, Stream. JuickMessage jmsg = (JuickMessage) msg.getChild(JuickMessage.XMLNS); if (jmsg != null) { logger.info("got jmsg: " + ms.serialize(jmsg).toString()); - if (jmsg.getMID() == 0) { + if (jmsg.getMid() == 0) { int uid_to = 0; try { uid_to = Integer.parseInt(msg.to.Username); @@ -109,11 +109,11 @@ public class XMPPConnection implements InitializingBean, DisposableBean, Stream. if (uid_to > 0) { onJuickPM(uid_to, jmsg); } - } else if (jmsg.getRID() == 0) { + } else if (jmsg.getRid() == 0) { onJuickMessagePost(jmsg); } else { // to get quote - com.juick.Message reply = MessagesQueries.getReply(jdbc, jmsg.getMID(), jmsg.getRID()); + com.juick.Message reply = MessagesQueries.getReply(jdbc, jmsg.getMid(), jmsg.getRid()); onJuickMessageReply(reply); } } @@ -124,9 +124,9 @@ public class XMPPConnection implements InitializingBean, DisposableBean, Stream. private void onJuickPM(final int uid_to, final com.juick.Message jmsg) { String json = messageSerializer.serialize(jmsg).toString(); synchronized (wsHandler.getClients()) { - wsHandler.getClients().stream().filter(c -> !c.legacy && c.visitor.getUID() == uid_to).forEach(c -> { + wsHandler.getClients().stream().filter(c -> !c.legacy && c.visitor.getUid() == uid_to).forEach(c -> { try { - logger.info("sending pm to " + c.visitor.getUID()); + logger.info("sending pm to " + c.visitor.getUid()); c.session.sendMessage(new TextMessage(json)); } catch (IOException e) { logger.warn("ws error", e); @@ -137,15 +137,15 @@ public class XMPPConnection implements InitializingBean, DisposableBean, Stream. private void onJuickMessagePost(final com.juick.Message jmsg) { String json = messageSerializer.serialize(jmsg).toString(); - List<Integer> uids = SubscriptionsQueries.getSubscribedUsers(jdbc, jmsg.getUser().getUID(), jmsg.getMID()) - .stream().map(User::getUID).collect(Collectors.toList()); + List<Integer> uids = SubscriptionsQueries.getSubscribedUsers(jdbc, jmsg.getUser().getUid(), jmsg.getMid()) + .stream().map(User::getUid).collect(Collectors.toList()); synchronized (wsHandler.getClients()) { wsHandler.getClients().stream().filter(c -> - (!c.legacy && c.visitor.getUID() == 0) // anonymous users - || (!c.legacy && uids.contains(c.visitor.getUID()))) // subscriptions + (!c.legacy && c.visitor.getUid() == 0) // anonymous users + || (!c.legacy && uids.contains(c.visitor.getUid()))) // subscriptions .forEach(c -> { try { - logger.info("sending message to " + c.visitor.getUID()); + logger.info("sending message to " + c.visitor.getUid()); c.session.sendMessage(new TextMessage(json)); } catch (IOException e) { logger.warn("ws error", e); @@ -155,7 +155,7 @@ public class XMPPConnection implements InitializingBean, DisposableBean, Stream. c.legacy && c.allMessages) // legacy all posts .forEach(c -> { try { - logger.info("sending message to legacy client " + c.visitor.getUID()); + logger.info("sending message to legacy client " + c.visitor.getUid()); c.session.sendMessage(new TextMessage(json)); } catch (IOException e) { logger.warn("ws error", e); @@ -167,25 +167,25 @@ public class XMPPConnection implements InitializingBean, DisposableBean, Stream. private void onJuickMessageReply(final com.juick.Message jmsg) { String json = messageSerializer.serialize(jmsg).toString(); List<Integer> threadUsers = - SubscriptionsQueries.getUsersSubscribedToComments(jdbc, jmsg.getMID(), jmsg.getUser().getUID()) - .stream().map(User::getUID).collect(Collectors.toList()); + SubscriptionsQueries.getUsersSubscribedToComments(jdbc, jmsg.getMid(), jmsg.getUser().getUid()) + .stream().map(User::getUid).collect(Collectors.toList()); synchronized (wsHandler.getClients()) { wsHandler.getClients().stream().filter(c -> - (!c.legacy && c.visitor.getUID() == 0) // anonymous users - || (!c.legacy && threadUsers.contains(c.visitor.getUID()))) // subscriptions + (!c.legacy && c.visitor.getUid() == 0) // anonymous users + || (!c.legacy && threadUsers.contains(c.visitor.getUid()))) // subscriptions .forEach(c -> { try { - logger.info("sending reply to " + c.visitor.getUID()); + logger.info("sending reply to " + c.visitor.getUid()); c.session.sendMessage(new TextMessage(json)); } catch (IOException e) { logger.warn("ws error", e); } }); wsHandler.getClients().stream().filter(c -> - (c.legacy && c.allReplies) || (c.legacy && c.MID == jmsg.getMID())) // legacy replies + (c.legacy && c.allReplies) || (c.legacy && c.MID == jmsg.getMid())) // legacy replies .forEach(c -> { try { - logger.info("sending reply to legacy client " + c.visitor.getUID()); + logger.info("sending reply to legacy client " + c.visitor.getUid()); c.session.sendMessage(new TextMessage(json)); } catch (IOException e) { logger.warn("ws error", e); |