aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-08-12 12:51:08 +0200
committerlain <lain@soykaf.club>2019-08-12 12:51:08 +0200
commit23c46f7e72701b773d87b825526450e5f4ec6322 (patch)
tree3f463132f9f299a44811ea04c085bfa30e1a469b /lib
parenta2b98f6d58218c5806247743aa0a2a600c9959ab (diff)
downloadpleroma-23c46f7e72701b773d87b825526450e5f4ec6322.tar.gz
Conversations: Use 'recipients' for accounts in conversation view.
According to gargron, this is the intended usage.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/views/conversation_view.ex15
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/conversation_view.ex b/lib/pleroma/web/mastodon_api/views/conversation_view.ex
index 5adaecdb0..4a81f0248 100644
--- a/lib/pleroma/web/mastodon_api/views/conversation_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/conversation_view.ex
@@ -12,7 +12,7 @@ defmodule Pleroma.Web.MastodonAPI.ConversationView do
alias Pleroma.Web.MastodonAPI.StatusView
def render("participation.json", %{participation: participation, user: user}) do
- participation = Repo.preload(participation, conversation: :users, recipients: [])
+ participation = Repo.preload(participation, conversation: [], recipients: [])
last_activity_id =
with nil <- participation.last_activity_id do
@@ -28,7 +28,7 @@ defmodule Pleroma.Web.MastodonAPI.ConversationView do
# Conversations return all users except the current user.
users =
- participation.conversation.users
+ participation.recipients
|> Enum.reject(&(&1.id == user.id))
accounts =
@@ -37,20 +37,11 @@ defmodule Pleroma.Web.MastodonAPI.ConversationView do
as: :user
})
- recipients =
- AccountView.render("accounts.json", %{
- users: participation.recipients,
- as: :user
- })
-
%{
id: participation.id |> to_string(),
accounts: accounts,
unread: !participation.read,
- last_status: last_status,
- pleroma: %{
- recipients: recipients
- }
+ last_status: last_status
}
end
end