From 4b3ddcd138af69f504a9a08281edc1c2e7eb0c7a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 28 Mar 2018 21:19:07 +0300 Subject: PM events --- .../main/java/com/juick/www/controllers/NewMessage.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'juick-www/src/main/java/com/juick/www/controllers') 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 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"); } -- cgit v1.2.3