aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-07-15 11:43:36 +0300
committerGravatar Vitaly Takmazov2018-07-15 11:43:36 +0300
commit3870fd009e13d728a343d2ebe79c4f6cd113f2ab (patch)
tree8718ba7d045a9ac7a337244373fbbd1af76b4966 /juick-server/src/main/java/com/juick/server
parent3936bb230a856c12a0afbab3fb1baa331beee337 (diff)
Api: read and readers in /me
Diffstat (limited to 'juick-server/src/main/java/com/juick/server')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Users.java10
1 files changed, 3 insertions, 7 deletions
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 a7ea7ea0..9a2b25d7 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
@@ -78,6 +78,8 @@ public class Users {
me.setName(visitor.getName());
me.setAuthHash(getAuthToken());
me.setUnreadCount(messagesService.getUnread(visitor).size());
+ me.setRead(userService.getUserFriends(visitor.getUid()));
+ me.setReaders(userService.getUserReaders(visitor.getUid()));
return me;
}
@@ -101,13 +103,7 @@ public class Users {
}
if (uid > 0) {
- List<Integer> uids = userService.getUserRead(uid);
- if (uids.size() > 0) {
- List<com.juick.User> users = userService.getUsersByID(uids);
- if (users.size() > 0) {
- return users;
- }
- }
+ return userService.getUserFriends(uid);
}
throw new HttpNotFoundException();
}