aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/api/Users.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-11-20 19:07:59 +0300
committerGravatar Vitaly Takmazov2018-11-20 19:07:59 +0300
commitb6bb0dc8a3391442fad0124baa12799982cd6d8d (patch)
tree664a6bdbc76cbc2219eb4c67f8aca875d83fccc0 /src/main/java/com/juick/server/api/Users.java
parent6d4f8164ac97690a1993981605435cdc6ff097f2 (diff)
fix api 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.java12
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 c1cee8b5..6f9ab290 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.getAvatarWebPath(u)));
+ users.forEach(u -> u.setAvatar(webApp.getAvatarUrl(u)));
if (!users.isEmpty())
return users;
if (!UserUtils.getCurrentUser().isAnonymous()) {
User visitor = UserUtils.getCurrentUser();
- visitor.setAvatar(webApp.getAvatarWebPath(visitor));
+ visitor.setAvatar(webApp.getAvatarUrl(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.getAvatarWebPath(visitor));
+ me.setAvatar(webApp.getAvatarUrl(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.getAvatarWebPath(f)));
+ friends.forEach(f -> f.setAvatar(webApp.getAvatarUrl(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.getAvatarWebPath(r)));
+ readers.forEach(r -> r.setAvatar(webApp.getAvatarUrl(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.getAvatarWebPath(user));
+ user.setAvatar(webApp.getAvatarUrl(user));
return userService.getUserInfo(user);
}
throw new HttpNotFoundException();