diff options
author | 2018-11-20 19:07:59 +0300 | |
---|---|---|
committer | 2018-11-20 19:07:59 +0300 | |
commit | b6bb0dc8a3391442fad0124baa12799982cd6d8d (patch) | |
tree | 664a6bdbc76cbc2219eb4c67f8aca875d83fccc0 /src/main/java/com/juick/server/api/Messages.java | |
parent | 6d4f8164ac97690a1993981605435cdc6ff097f2 (diff) |
fix api avatar urls
Diffstat (limited to 'src/main/java/com/juick/server/api/Messages.java')
-rw-r--r-- | src/main/java/com/juick/server/api/Messages.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/juick/server/api/Messages.java b/src/main/java/com/juick/server/api/Messages.java index 4ce1ea13..e105890f 100644 --- a/src/main/java/com/juick/server/api/Messages.java +++ b/src/main/java/com/juick/server/api/Messages.java @@ -78,7 +78,7 @@ public class Messages { int vuid = visitor.getUid(); List<Integer> mids = messagesService.getMyFeed(vuid, before_mid, true); List<Message> msgs = messagesService.getMessages(visitor, mids); - msgs.forEach(m -> m.getUser().setAvatar(webApp.getAvatarWebPath(m.getUser()))); + msgs.forEach(m -> m.getUser().setAvatar(webApp.getAvatarUrl(m.getUser()))); return ResponseEntity.ok(msgs); } return FORBIDDEN; @@ -141,7 +141,7 @@ public class Messages { } } List<Message> msgs = messagesService.getMessages(visitor, mids); - msgs.forEach(m -> m.getUser().setAvatar(webApp.getAvatarWebPath(m.getUser()))); + msgs.forEach(m -> m.getUser().setAvatar(webApp.getAvatarUrl(m.getUser()))); return ResponseEntity.ok(msgs); } @DeleteMapping("/api/messages") @@ -161,7 +161,7 @@ public class Messages { public List<Message> getDiscussions( @RequestParam(required = false, defaultValue = "0") Long to) { List<Message> msgs = messagesService.getMessages(UserUtils.getCurrentUser(), messagesService.getDiscussions(UserUtils.getCurrentUser().getUid(), to)); - msgs.forEach(m -> m.getUser().setAvatar(webApp.getAvatarWebPath(m.getUser()))); + msgs.forEach(m -> m.getUser().setAvatar(webApp.getAvatarUrl(m.getUser()))); return msgs; } @GetMapping("/api/thread") @@ -177,10 +177,10 @@ public class Messages { if (userService.getUserByName(msg.getUser().getName()).isBanned()) { throw new HttpNotFoundException(); } - msg.getUser().setAvatar(webApp.getAvatarWebPath(msg.getUser())); + msg.getUser().setAvatar(webApp.getAvatarUrl(msg.getUser())); msg.setRecommendations(new HashSet<>(messagesService.getMessageRecommendations(msg.getMid()))); List<com.juick.Message> replies = messagesService.getReplies(visitor, mid); - replies.forEach(m -> m.getUser().setAvatar(webApp.getAvatarWebPath(m.getUser()))); + replies.forEach(m -> m.getUser().setAvatar(webApp.getAvatarUrl(m.getUser()))); if (!visitor.isAnonymous()) { userService.updateLastSeen(visitor); applicationEventPublisher.publishEvent( |