diff options
author | Vitaly Takmazov | 2016-11-15 16:55:55 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-11-15 16:55:55 +0300 |
commit | e000cd1e5643a5a46e99aee931b4fc35a255c36c (patch) | |
tree | 2dd5633b36daefe5086cc4a5e500158d07799f10 | |
parent | 4a1adf3e21e52a70799ebfa1b43f532d5696860e (diff) |
juick-notifications: fix pms
-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 { |