Emoji reactions: Change cache and reply format

This commit is contained in:
lain 2020-01-22 13:57:42 +01:00
commit dd3fc50ea4
6 changed files with 70 additions and 40 deletions

View file

@ -255,12 +255,11 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
emoji_reactions =
with %{data: %{"reactions" => emoji_reactions}} <- object do
Enum.map(emoji_reactions, fn {emoji, users} ->
{emoji, length(users)}
Enum.map(emoji_reactions, fn [emoji, users] ->
[emoji, length(users)]
end)
|> Enum.into(%{})
else
_ -> %{}
_ -> []
end
%{