From e000cd1e5643a5a46e99aee931b4fc35a255c36c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 15 Nov 2016 16:55:55 +0300 Subject: juick-notifications: fix pms --- .../src/main/java/com/juick/components/Notifications.java | 10 +++++----- 1 file 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 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>() { }).getBody()); } else { @@ -137,7 +137,7 @@ public class Notifications implements InitializingBean { final List 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>() { }).getBody()); } else { @@ -184,7 +184,7 @@ public class Notifications implements InitializingBean { final List 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>() { }).getBody()); } else { -- cgit v1.2.3