aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--juick-common/src/main/java/com/juick/User.java9
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Users.java4
2 files changed, 12 insertions, 1 deletions
diff --git a/juick-common/src/main/java/com/juick/User.java b/juick-common/src/main/java/com/juick/User.java
index 3b74f31c..b81739a2 100644
--- a/juick-common/src/main/java/com/juick/User.java
+++ b/juick-common/src/main/java/com/juick/User.java
@@ -48,6 +48,7 @@ public class User {
private List<ExternalToken> tokens;
private List<User> read;
private List<User> readers;
+ private List<Integer> unread;
public User() {
tokens = new ArrayList<>();
@@ -199,4 +200,12 @@ public class User {
public void setReaders(List<User> readers) {
this.readers = readers;
}
+
+ public List<Integer> getUnread() {
+ return unread;
+ }
+
+ public void setUnread(List<Integer> unread) {
+ this.unread = unread;
+ }
}
diff --git a/juick-server/src/main/java/com/juick/server/api/Users.java b/juick-server/src/main/java/com/juick/server/api/Users.java
index 9a2b25d7..41deddb8 100644
--- a/juick-server/src/main/java/com/juick/server/api/Users.java
+++ b/juick-server/src/main/java/com/juick/server/api/Users.java
@@ -77,7 +77,9 @@ public class Users {
me.setUid(visitor.getUid());
me.setName(visitor.getName());
me.setAuthHash(getAuthToken());
- me.setUnreadCount(messagesService.getUnread(visitor).size());
+ List<Integer> unread = messagesService.getUnread(visitor);
+ me.setUnread(unread);
+ me.setUnreadCount(unread.size());
me.setRead(userService.getUserFriends(visitor.getUid()));
me.setReaders(userService.getUserReaders(visitor.getUid()));
return me;