aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/api/Messages.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-11-20 17:42:39 +0300
committerGravatar Vitaly Takmazov2018-11-20 17:42:39 +0300
commit6d4f8164ac97690a1993981605435cdc6ff097f2 (patch)
treeaf86327338539d41707a0e6b6c1c2d46fece8878 /src/main/java/com/juick/server/api/Messages.java
parentb5eed5e659c94eb618b3f35dff92988e2860235c (diff)
fix web 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.java10
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 8aae0d57..4ce1ea13 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.getAvatarPublicUrl(m.getUser())));
+ msgs.forEach(m -> m.getUser().setAvatar(webApp.getAvatarWebPath(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.getAvatarPublicUrl(m.getUser())));
+ msgs.forEach(m -> m.getUser().setAvatar(webApp.getAvatarWebPath(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.getAvatarPublicUrl(m.getUser())));
+ msgs.forEach(m -> m.getUser().setAvatar(webApp.getAvatarWebPath(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.getAvatarPublicUrl(msg.getUser()));
+ msg.getUser().setAvatar(webApp.getAvatarWebPath(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.getAvatarPublicUrl(m.getUser())));
+ replies.forEach(m -> m.getUser().setAvatar(webApp.getAvatarWebPath(m.getUser())));
if (!visitor.isAnonymous()) {
userService.updateLastSeen(visitor);
applicationEventPublisher.publishEvent(