aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/api/Users.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2020-02-27 10:03:25 +0300
committerGravatar Vitaly Takmazov2020-02-27 10:03:25 +0300
commit8f3a101df251de5965ca28086974c2c10f60c6d9 (patch)
tree32caa77a9b815db6355581a0aca00bf60d17d9e4 /src/main/java/com/juick/server/api/Users.java
parente9d1aa38a36816138897e38b076ff69c71b4cc14 (diff)
Include avatars for readers and friends on /me API endpoint
Diffstat (limited to 'src/main/java/com/juick/server/api/Users.java')
-rw-r--r--src/main/java/com/juick/server/api/Users.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/com/juick/server/api/Users.java b/src/main/java/com/juick/server/api/Users.java
index db8267bb..c909fb38 100644
--- a/src/main/java/com/juick/server/api/Users.java
+++ b/src/main/java/com/juick/server/api/Users.java
@@ -107,8 +107,12 @@ public class Users {
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()));
+ var friends = userService.getUserFriends(visitor.getUid());
+ friends.forEach(r -> r.setAvatar(webApp.getAvatarUrl(r)));
+ me.setRead(friends);
+ var readers = userService.getUserReaders(visitor.getUid());
+ readers.forEach(r -> r.setAvatar(webApp.getAvatarUrl(r)));
+ me.setReaders(readers);
me.setAvatar(webApp.getAvatarUrl(visitor));
me.getTagStats().addAll(tagService.getUserTagStats(me.getUid()));
return (SecureUser)userService.getUserInfo(me);