diff options
author | 2016-05-13 16:22:13 +0300 | |
---|---|---|
committer | 2016-05-13 16:22:13 +0300 | |
commit | 0ae572563427dcaba845b893bcef35fe7f172dd8 (patch) | |
tree | 44a1ac6e822557c77df3e537f61830c58ae0afeb /src/main/java/com/juick/PushComponent.java | |
parent | 8e4ab831c7342d3fc4a7829c10152d41c3e61f1e (diff) | |
parent | c4d77b873c4deb15a968ac17998a024bd0c618d4 (diff) |
Merge branch 'rebase_all' of ssh://den.jabber.ru:2205/var/lib/git/com.juick.http.www into rebase_all
Diffstat (limited to 'src/main/java/com/juick/PushComponent.java')
-rw-r--r-- | src/main/java/com/juick/PushComponent.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/main/java/com/juick/PushComponent.java b/src/main/java/com/juick/PushComponent.java index 688f1cdd..386448f4 100644 --- a/src/main/java/com/juick/PushComponent.java +++ b/src/main/java/com/juick/PushComponent.java @@ -170,14 +170,8 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe boolean isPM = jmsg.getMID() == 0; boolean isReply = jmsg.getRID() > 0; int senderID = 0, recipientID = 0; - // reply pushed to original sender if (isReply) { - com.juick.Message op = MessagesQueries.getMessage(sql, jmsg.getMID()); - senderID = op.getUser().getUID(); - // do not notify self - if (jmsg.getUser().getUID() == op.getUser().getUID()) { - return; - } + senderID = jmsg.getUser().getUID(); } if (isPM) { // PM @@ -198,7 +192,7 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe regids.add(targetId); } } else { - regids = PushQueries.getAndroidSubscribers(sql, senderID); + regids = isReply ? PushQueries.getAndroidSubscribersToComments(sql, jmsg.getMID(), senderID) : PushQueries.getAndroidSubscribers(sql, senderID); } if (!regids.isEmpty()) { @@ -230,7 +224,7 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe urls.add(targetURL); } } else { - urls = PushQueries.getWinPhoneSubscribers(sql, senderID); + urls = isReply ? PushQueries.getWindowsSubscribersToComments(sql, jmsg.getMID(), senderID) :PushQueries.getWinPhoneSubscribers(sql, senderID); } @@ -276,7 +270,7 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe tokens.add(targetToken); } } else { - tokens = PushQueries.getAPNSSubscribers(sql, senderID); + tokens = isReply ? PushQueries.getAppleSubscribersToComments(sql, jmsg.getMID(), senderID) : PushQueries.getAPNSSubscribers(sql, senderID); } if (!tokens.isEmpty()) { ApnsService service = APNS.newService().withCert("/etc/juick/ios.p12", "juick") |