forked from AkkomaGang/akkoma
mastodon api: fix rendering the mentions JSON
Signed-off-by: lain <lain@soykaf.club>
This commit is contained in:
parent
59a76ea464
commit
000b3f1837
1 changed files with 2 additions and 2 deletions
|
@ -16,7 +16,7 @@ def render("status.json", %{activity: %{data: %{"type" => "Announce", "object" =
|
|||
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 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity}
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue