diff options
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") |