aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-30 16:45:00 +0300
committerGravatar Vitaly Takmazov2018-10-30 16:45:00 +0300
commitcdd36f5e71da5f0c0795df2b21ec3623d7ef9f59 (patch)
treefe93ac73435f64ad960def08ad6cca4a681c9088 /juick-server/src
parent2371d2d20d038992072f88eb63049bded18ab47f (diff)
notifications: collect tokens for read event
Diffstat (limited to 'juick-server/src')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Notifications.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/Notifications.java b/juick-server/src/main/java/com/juick/server/api/Notifications.java
index bc3d98bf..62275f5a 100644
--- a/juick-server/src/main/java/com/juick/server/api/Notifications.java
+++ b/juick-server/src/main/java/com/juick/server/api/Notifications.java
@@ -81,6 +81,7 @@ public class Notifications {
return ResponseEntity.ok(Collections.singletonList(collectTokens(uid)));
} else {
if (mid > 0) {
+ // reply
Message msg = messagesService.getMessage(mid);
if (msg != null) {
List<User> users;
@@ -95,6 +96,9 @@ public class Notifications {
return ResponseEntity.ok(users.stream().map(User::getUid)
.map(this::collectTokens).collect(Collectors.toList()));
}
+ } else {
+ // read
+ return ResponseEntity.ok(Collections.singletonList(collectTokens(uid)));
}
}
throw new HttpBadRequestException();