ConversationView: add current user to conversations, according to Mastodon behaviour

This commit is contained in:
Alibek Omarov 2020-10-16 18:28:27 +00:00 committed by Gitea
parent 131f3219e6
commit 241bd061fc

View file

@ -33,12 +33,10 @@ def render("participation.json", %{participation: participation, for: user}) do
end end
activity = Activity.get_by_id_with_object(last_activity_id) 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(), 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, unread: !participation.read,
last_status: last_status:
render(StatusView, "show.json", render(StatusView, "show.json",