ConversationView: add current user to conversations, according to Mastodon behaviour
authorAlibek Omarov <a1ba.omarov@gmail.com>
Fri, 16 Oct 2020 18:28:27 +0000 (18:28 +0000)
committerGitea <gitea@fake.local>
Fri, 30 Oct 2020 11:58:51 +0000 (12:58 +0100)
lib/pleroma/web/mastodon_api/views/conversation_view.ex

index a91994915facbf3c01afa39383f35e0881ecda1e..cf34933ab52e0a1c9a3483923addc0dcfe191531 100644 (file)
@@ -33,12 +33,10 @@ defmodule Pleroma.Web.MastodonAPI.ConversationView do
       end
 
     activity = Activity.get_by_id_with_object(last_activity_id)
-    # Conversations return all users except the current user.
-    users = Enum.reject(participation.recipients, &(&1.id == user.id))
 
     %{
       id: participation.id |> to_string(),
-      accounts: render(AccountView, "index.json", users: users, for: user),
+      accounts: render(AccountView, "index.json", users: participation.recipients, for: user),
       unread: !participation.read,
       last_status:
         render(StatusView, "show.json",