diff options
author | William Pitcock <nenolod@dereferenced.org> | 2018-03-16 05:30:02 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-03-16 11:25:41 +0100 |
commit | 000b3f1837d81f46e183f21150972c8c0b0a9115 (patch) | |
tree | 541205ca4aa17bc356fd872b68445d522c23ef7b /lib | |
parent | 59a76ea464998476f8c4814324647f4ae4a7f2cb (diff) | |
download | pleroma-000b3f1837d81f46e183f21150972c8c0b0a9115.tar.gz |
mastodon api: fix rendering the mentions JSON
Signed-off-by: lain <lain@soykaf.club>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/status_view.ex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 4f395d0f7..55675ae1c 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -16,7 +16,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do reblogged = Activity.get_create_activity_by_object_ap_id(object) reblogged = render("status.json", Map.put(opts, :activity, reblogged)) - mentions = activity.data["to"] + mentions = activity.recipients |> Enum.map(fn (ap_id) -> User.get_cached_by_ap_id(ap_id) end) |> Enum.filter(&(&1)) |> Enum.map(fn (user) -> AccountView.render("mention.json", %{user: user}) end) @@ -60,7 +60,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do tags = object["tag"] || [] sensitive = object["sensitive"] || Enum.member?(tags, "nsfw") - mentions = activity.data["to"] + mentions = activity.recipients |> Enum.map(fn (ap_id) -> User.get_cached_by_ap_id(ap_id) end) |> Enum.filter(&(&1)) |> Enum.map(fn (user) -> AccountView.render("mention.json", %{user: user}) end) |