diff options
author | Vitaly Takmazov | 2018-11-20 17:42:39 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-11-20 17:42:39 +0300 |
commit | 6d4f8164ac97690a1993981605435cdc6ff097f2 (patch) | |
tree | af86327338539d41707a0e6b6c1c2d46fece8878 /src/main/java/com/juick/server/api/Users.java | |
parent | b5eed5e659c94eb618b3f35dff92988e2860235c (diff) |
fix web avatar urls
Diffstat (limited to 'src/main/java/com/juick/server/api/Users.java')
-rw-r--r-- | src/main/java/com/juick/server/api/Users.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/com/juick/server/api/Users.java b/src/main/java/com/juick/server/api/Users.java index 791071a5..c1cee8b5 100644 --- a/src/main/java/com/juick/server/api/Users.java +++ b/src/main/java/com/juick/server/api/Users.java @@ -69,12 +69,12 @@ public class Users { if (!unames.isEmpty() && unames.size() < 20) users.addAll(userService.getUsersByName(unames)); } - users.forEach(u -> u.setAvatar(webApp.getAvatarPublicUrl(u))); + users.forEach(u -> u.setAvatar(webApp.getAvatarWebPath(u))); if (!users.isEmpty()) return users; if (!UserUtils.getCurrentUser().isAnonymous()) { User visitor = UserUtils.getCurrentUser(); - visitor.setAvatar(webApp.getAvatarPublicUrl(visitor)); + visitor.setAvatar(webApp.getAvatarWebPath(visitor)); return Collections.singletonList(visitor); } @@ -93,7 +93,7 @@ public class Users { me.setUnreadCount(unread.size()); me.setRead(userService.getUserFriends(visitor.getUid())); me.setReaders(userService.getUserReaders(visitor.getUid())); - me.setAvatar(webApp.getAvatarPublicUrl(visitor)); + me.setAvatar(webApp.getAvatarWebPath(visitor)); return me; } @@ -118,7 +118,7 @@ public class Users { if (uid > 0) { List<User> friends = userService.getUserFriends(uid); - friends.forEach(f -> f.setAvatar(webApp.getAvatarPublicUrl(f))); + friends.forEach(f -> f.setAvatar(webApp.getAvatarWebPath(f))); return friends; } throw new HttpNotFoundException(); @@ -145,7 +145,7 @@ public class Users { if (uid > 0) { List<User> readers = userService.getUserReaders(uid); - readers.forEach(r -> r.setAvatar(webApp.getAvatarPublicUrl(r))); + readers.forEach(r -> r.setAvatar(webApp.getAvatarWebPath(r))); return readers; } throw new HttpNotFoundException(); @@ -155,7 +155,7 @@ public class Users { public UserInfo getUserInfo(@PathVariable String uname) { User user = userService.getUserByName(uname); if (!user.isBanned()) { - user.setAvatar(webApp.getAvatarPublicUrl(user)); + user.setAvatar(webApp.getAvatarWebPath(user)); return userService.getUserInfo(user); } throw new HttpNotFoundException(); |