From bc668ba68f1d7930d507a7193bf124c8d854687e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 6 Jan 2023 04:20:48 +0300 Subject: Mastodon API: exclude visitor from Conversation accounts list --- src/main/java/com/juick/www/api/Mastodon.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/com/juick/www/api/Mastodon.java b/src/main/java/com/juick/www/api/Mastodon.java index b23ec9c1..9ea937d1 100644 --- a/src/main/java/com/juick/www/api/Mastodon.java +++ b/src/main/java/com/juick/www/api/Mastodon.java @@ -222,18 +222,18 @@ public class Mastodon { ); } - public Conversation toConversation(User user, Chat chat) { + public Conversation toConversation(Chat chat) { return new Conversation( String.valueOf(chat.getUid()), chat.getUnread() != null && chat.getUnread().size() > 0, - List.of(toAccount(user), toAccount(chat)), + List.of(toAccount(chat)), mapLastMessage(chat)); } @GetMapping("/api/v1/conversations") public List conversations(@ModelAttribute User visitor) { return chatService.getLastChats(visitor).stream().map( - chat -> toConversation(visitor, chat) + this::toConversation ).collect(Collectors.toList()); } } -- cgit v1.2.3