TwitterAPI: Fix mentions.

This commit is contained in:
lain 2018-02-20 19:50:34 +01:00
parent 95f7e7e2d5
commit fd95075e32
1 changed files with 1 additions and 1 deletions

View File

@ -126,7 +126,7 @@ def to_map(%Activity{data: %{"object" => %{"content" => content} = object}} = ac
mentions = opts[:mentioned] || [] mentions = opts[:mentioned] || []
attentions = activity.data["to"] attentions = activity.recipients
|> Enum.map(fn (ap_id) -> Enum.find(mentions, fn(user) -> ap_id == user.ap_id end) end) |> Enum.map(fn (ap_id) -> Enum.find(mentions, fn(user) -> ap_id == user.ap_id end) end)
|> Enum.filter(&(&1)) |> Enum.filter(&(&1))
|> Enum.map(fn (user) -> UserView.render("show.json", %{user: user, for: opts[:for]}) end) |> Enum.map(fn (user) -> UserView.render("show.json", %{user: user, for: opts[:for]}) end)