diff options
Diffstat (limited to 'src/main/java/com/juick/PushComponent.java')
-rw-r--r-- | src/main/java/com/juick/PushComponent.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/java/com/juick/PushComponent.java b/src/main/java/com/juick/PushComponent.java index 6fccce1e..533ca086 100644 --- a/src/main/java/com/juick/PushComponent.java +++ b/src/main/java/com/juick/PushComponent.java @@ -166,15 +166,15 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe } logger.info("Message to push: " + msg.toString()); - boolean isPM = jmsg.MID == 0; - boolean isReply = jmsg.RID > 0; + 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.MID); - senderID = op.User.UID; + com.juick.Message op = MessagesQueries.getMessage(sql, jmsg.getMID()); + senderID = op.getUser().getUID(); // do not notify self - if (jmsg.User.UID == op.User.UID) { + if (jmsg.getUser().getUID() == op.getUser().getUID()) { return; } } @@ -189,7 +189,7 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe } /*** ANDROID ***/ - ArrayList<String> regids; + List<String> regids; if (isPM) { regids = new ArrayList<String>(); String targetId = PushQueries.getAndroidRegID(sql, recipientID); @@ -221,7 +221,7 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe } /*** WinPhone ***/ - ArrayList<String> urls; + List<String> urls; if (isPM) { urls = new ArrayList<String>(); String targetURL = PushQueries.getWinPhoneURL(sql, recipientID); @@ -233,11 +233,11 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe } if (!urls.isEmpty()) { - String text1 = "@" + jmsg.User.UName; + String text1 = "@" + jmsg.getUser().getUName(); if (!jmsg.Tags.isEmpty()) { text1 += ":" + XmlUtils.escape(jmsg.getTagsString()); } - String text2 = XmlUtils.escape(jmsg.Text); + String text2 = XmlUtils.escape(jmsg.getText()); String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<toast>" + "<visual>" @@ -248,7 +248,7 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe + "</binding>" + "</visual>" + "<commands>" - + "<command arguments=\"?mid=" + jmsg.MID + "\" />" + + "<command arguments=\"?mid=" + jmsg.getMID() + "\" />" + "</commands>" + "</toast>"; logger.fine(xml); @@ -277,7 +277,7 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe ApnsService service = APNS.newService().withCert("/etc/juick/ios.p12", "juick") .withSandboxDestination().build(); for (String token : tokens) { - String payload = APNS.newPayload().alertTitle("@" + jmsg.User.UName).alertBody(jmsg.Text).build(); + String payload = APNS.newPayload().alertTitle("@" + jmsg.getUser().getUName()).alertBody(jmsg.getText()).build(); logger.info("APNS: " + token); service.push(token, payload); } |