aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/api/Messages.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-06-25 08:33:55 +0300
committerGravatar Vitaly Takmazov2022-06-25 08:33:55 +0300
commit7692b9f126de590d8d1db3e4bed2b4c9c1345e25 (patch)
tree019b570e5d01a639c3b37b8c2779576ba397235a /src/main/java/com/juick/www/api/Messages.java
parent0e99af4f3a5e7c3941750de4709f69337f9f7d0f (diff)
`likes` field returns recommendations count
Diffstat (limited to 'src/main/java/com/juick/www/api/Messages.java')
-rw-r--r--src/main/java/com/juick/www/api/Messages.java4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/main/java/com/juick/www/api/Messages.java b/src/main/java/com/juick/www/api/Messages.java
index ab222a3c..a79088d0 100644
--- a/src/main/java/com/juick/www/api/Messages.java
+++ b/src/main/java/com/juick/www/api/Messages.java
@@ -170,14 +170,10 @@ public class Messages {
throw new HttpForbiddenException();
} else {
msg.getUser().setAvatar(webApp.getAvatarUrl(msg.getUser()));
- msg.setRecommendations(new HashSet<>(
- messagesService.getMessagesRecommendations(Collections.singletonList(msg.getMid())).stream()
- .map(Pair::getRight).collect(Collectors.toList())));
msg.getRecommendations().forEach(r -> r.setAvatar(webApp.getAvatarUrl(r)));
List<Message> replies = messagesService.getReplies(visitor, mid);
// update replies counter to exclude banned replies
msg.setReplies(replies.size());
- replies.forEach(m -> m.getUser().setAvatar(webApp.getAvatarUrl(m.getUser())));
if (!visitor.isAnonymous()) {
userService.updateLastSeen(visitor);
applicationEventPublisher.publishEvent(new SystemEvent(this, SystemActivity.read(visitor, msg)));