diff options
Diffstat (limited to 'juick-notifications/src/main/java/com/juick/components')
-rw-r--r-- | juick-notifications/src/main/java/com/juick/components/Notifications.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/Notifications.java b/juick-notifications/src/main/java/com/juick/components/Notifications.java index e449abef..5b51c65d 100644 --- a/juick-notifications/src/main/java/com/juick/components/Notifications.java +++ b/juick-notifications/src/main/java/com/juick/components/Notifications.java @@ -97,13 +97,13 @@ public class Notifications implements InitializingBean { com.juick.Message jmsg = msg.getExtension(com.juick.Message.class); boolean isPM = jmsg.getMid() == 0; boolean isReply = jmsg.getRid() > 0; - int pmTo = 0; + int pmTo = NumberUtils.toInt(msg.getTo().getLocal(), 0); /*** ANDROID ***/ final List<String> regids = new ArrayList<>(); if (isPM) { - regids.addAll(rest.exchange(String.format("http://api.juick.com/notifications?type=gcm&uid=%s", - jmsg.getUser().getUid()), + regids.addAll(rest.exchange(String.format("http://api.juick.com/notifications?type=gcm&uid=%d", + pmTo), HttpMethod.GET, null, new ParameterizedTypeReference<List<String>>() { }).getBody()); } else { @@ -137,7 +137,7 @@ public class Notifications implements InitializingBean { final List<String> urls = new ArrayList<>(); if (isPM) { urls.addAll(rest.exchange(String.format("http://api.juick.com/notifications?type=mpns&uid=%s", - jmsg.getUser().getUid()), + pmTo), HttpMethod.GET, null, new ParameterizedTypeReference<List<String>>() { }).getBody()); } else { @@ -184,7 +184,7 @@ public class Notifications implements InitializingBean { final List<String> tokens = new ArrayList<>(); if (isPM) { tokens.addAll(rest.exchange(String.format("http://api.juick.com/notifications?type=apns&uid=%s", - jmsg.getUser().getUid()), + pmTo), HttpMethod.GET, null, new ParameterizedTypeReference<List<String>>() { }).getBody()); } else { |