diff options
author | Vitaly Takmazov | 2018-03-28 21:19:07 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-03-28 21:19:07 +0300 |
commit | 4b3ddcd138af69f504a9a08281edc1c2e7eb0c7a (patch) | |
tree | d1e6b3cc63184564a0ab3d7c59513e5e46b15b1c /juick-www/src/main/java/com/juick/www/controllers | |
parent | 31226138eb63b25a3b666ad782412a2024b50f74 (diff) |
PM events
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/controllers')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/controllers/NewMessage.java | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java index 2669c5ec..4192bc11 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java +++ b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java @@ -352,26 +352,13 @@ public class NewMessage { if (xmpp.isConnected()) { Message msg = new Message(); msg.setFrom(Jid.of("juick@juick.com")); + msg.setTo(Jid.of("pm@s2s.juick.com")); com.juick.Message jmsg = new com.juick.Message(); jmsg.setUser(visitor); jmsg.setText(body); jmsg.setTo(userTo); msg.addExtension(jmsg); - - List<String> jids = userService.getJIDsbyUID(userTo.getUid()); - for (String jid : jids) { - Message mm = new Message(); - mm.setTo(Jid.of(jid)); - mm.setType(Message.Type.CHAT); - if (pmQueriesService.havePMinRoster(visitor.getUid(), jid)) { - mm.setFrom(Jid.of(jmsg.getUser().getName(), "juick.com", "Juick")); - mm.setBody(body); - } else { - mm.setFrom(Jid.of("juick", "juick.com", "Juick")); - mm.setBody("Private message from @" + jmsg.getUser().getName() + ":\n" + body); - } - xmpp.send(mm); - } + xmpp.send(msg); } else { logger.warn("XMPP unavailable"); } |