projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into fix/attachments-cleanup
[akkoma]
/
lib
/
pleroma
/
web
/
mastodon_api
/
views
/
status_view.ex
diff --git
a/lib/pleroma/web/mastodon_api/views/status_view.ex
b/lib/pleroma/web/mastodon_api/views/status_view.ex
index a0257dfa6a0ee1705edf57ecb549e5270476aeba..b59ac39bc4908f6d7453b6d2fb1c70976d759ee9 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/views/status_view.ex
+++ b/
lib/pleroma/web/mastodon_api/views/status_view.ex
@@
-253,6
+253,16
@@
defmodule Pleroma.Web.MastodonAPI.StatusView do
nil
end
nil
end
+ emoji_reactions =
+ with %{data: %{"reactions" => emoji_reactions}} <- object do
+ Enum.map(emoji_reactions, fn {emoji, users} ->
+ {emoji, length(users)}
+ end)
+ |> Enum.into(%{})
+ else
+ _ -> %{}
+ end
+
%{
id: to_string(activity.id),
uri: object.data["id"],
%{
id: to_string(activity.id),
uri: object.data["id"],
@@
-293,7
+303,8
@@
defmodule Pleroma.Web.MastodonAPI.StatusView do
spoiler_text: %{"text/plain" => summary_plaintext},
expires_at: expires_at,
direct_conversation_id: direct_conversation_id,
spoiler_text: %{"text/plain" => summary_plaintext},
expires_at: expires_at,
direct_conversation_id: direct_conversation_id,
- thread_muted: thread_muted?
+ thread_muted: thread_muted?,
+ emoji_reactions: emoji_reactions
}
}
end
}
}
end
@@
-421,7
+432,8
@@
defmodule Pleroma.Web.MastodonAPI.StatusView do
end
end
end
end
- def render_content(%{data: %{"type" => "Video"}} = object) do
+ def render_content(%{data: %{"type" => object_type}} = object)
+ when object_type in ["Video", "Event"] do
with name when not is_nil(name) and name != "" <- object.data["name"] do
"<p><a href=\"#{object.data["id"]}\">#{name}</a></p>#{object.data["content"]}"
else
with name when not is_nil(name) and name != "" <- object.data["name"] do
"<p><a href=\"#{object.data["id"]}\">#{name}</a></p>#{object.data["content"]}"
else