aboutsummaryrefslogtreecommitdiff
path: root/juick-notifications/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-notifications/src/main/java')
-rw-r--r--juick-notifications/src/main/java/com/juick/components/Notifications.java6
1 files changed, 2 insertions, 4 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 a43d985c..410debd4 100644
--- a/juick-notifications/src/main/java/com/juick/components/Notifications.java
+++ b/juick-notifications/src/main/java/com/juick/components/Notifications.java
@@ -81,18 +81,16 @@ public class Notifications implements NotificationClientListener, AutoCloseable,
@Override
public void onApplicationEvent(@Nonnull MessageEvent event) {
com.juick.Message jmsg = event.getMessage();
- boolean isPM = jmsg.getMid() == 0;
- boolean isReply = jmsg.getRid() > 0;
User pmTo = jmsg.getTo();
final List<User> users = new ArrayList<>();
- if (isPM) {
+ if (MessageUtils.isPM(jmsg)) {
users.addAll(rest.exchange(String.format("http://api.juick.com/notifications?uid=%d",
pmTo.getUid()),
HttpMethod.GET, null, new ParameterizedTypeReference<List<User>>() {
}).getBody());
} else {
- if (isReply) {
+ if (MessageUtils.isReply(jmsg)) {
users.addAll(rest.exchange(String.format("http://api.juick.com/notifications?uid=%d&mid=%d&rid=%d",
jmsg.getUser().getUid(), jmsg.getMid(), jmsg.getRid()),
HttpMethod.GET, null, new ParameterizedTypeReference<List<User>>() {