aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-28 21:19:07 +0300
committerGravatar Vitaly Takmazov2018-03-28 21:19:07 +0300
commit4b3ddcd138af69f504a9a08281edc1c2e7eb0c7a (patch)
treed1e6b3cc63184564a0ab3d7c59513e5e46b15b1c /juick-www/src/main/java/com/juick/www
parent31226138eb63b25a3b666ad782412a2024b50f74 (diff)
PM events
Diffstat (limited to 'juick-www/src/main/java/com/juick/www')
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/NewMessage.java17
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");
}