From cdd36f5e71da5f0c0795df2b21ec3623d7ef9f59 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 30 Oct 2018 16:45:00 +0300 Subject: notifications: collect tokens for read event --- juick-server/src/main/java/com/juick/server/api/Notifications.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'juick-server/src/main/java') 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 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(); -- cgit v1.2.3