aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-12-09 00:02:00 +0300
committerGravatar Vitaly Takmazov2016-12-09 00:02:00 +0300
commit22d30c3b50fe0ea4c18c45a4450fb1a8b1f1b1b8 (patch)
treef79493ff675aa4c546b4a9a835998fbe8f457398
parenteaf87f0422af1a1f86526ea9218cd2193202af64 (diff)
juick-notifications: fix reply notifications
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Notifications.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Notifications.java b/juick-api/src/main/java/com/juick/api/controllers/Notifications.java
index fb89e472..ff3679c0 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Notifications.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Notifications.java
@@ -51,7 +51,8 @@ public class Notifications {
if ((visitor.getUid() == 0) || !(visitor.getName().equals("juick"))) {
throw new HttpForbiddenException();
}
- if (uid > 0) {
+ if (uid > 0 && mid == 0) {
+ // PM
switch (type) {
case "gcm":
return ResponseEntity.ok(pushQueriesService.getGCMRegID(uid));
@@ -69,7 +70,7 @@ public class Notifications {
if (msg != null) {
List<User> users;
if (msg.getRid() > 0) {
- users = subscriptionService.getUsersSubscribedToComments(mid, msg.getUser().getUid());
+ users = subscriptionService.getUsersSubscribedToComments(mid, uid);
} else {
users = subscriptionService.getSubscribedUsers(msg.getUser().getUid(), mid);
}