EmojiReactions: Add Mastodon-aligned reaction endpoints, change response

This commit is contained in:
Lain Soykaf 2020-02-07 14:52:13 +01:00
commit f875b9650a
5 changed files with 96 additions and 12 deletions

View file

@ -242,9 +242,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
with %{data: %{"reactions" => emoji_reactions}} <- object do
Enum.map(emoji_reactions, fn [emoji, users] ->
%{
emoji: emoji,
name: emoji,
count: length(users),
reacted: !!(opts[:for] && opts[:for].ap_id in users)
me: !!(opts[:for] && opts[:for].ap_id in users)
}
end)
else