Emoji Reactions: Add reacted field to emoji reactions
This commit is contained in:
parent
f1d5c0f079
commit
a802e07241
4 changed files with 37 additions and 8 deletions
|
|
@ -256,7 +256,11 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
|||
emoji_reactions =
|
||||
with %{data: %{"reactions" => emoji_reactions}} <- object do
|
||||
Enum.map(emoji_reactions, fn [emoji, users] ->
|
||||
%{emoji: emoji, count: length(users)}
|
||||
%{
|
||||
emoji: emoji,
|
||||
count: length(users),
|
||||
reacted: !!(opts[:for] && opts[:for].ap_id in users)
|
||||
}
|
||||
end)
|
||||
else
|
||||
_ -> []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue