From 57b24b2cbaba9a85a715a311db31654995232b10 Mon Sep 17 00:00:00 2001 From: lain Date: Sat, 31 Mar 2018 18:22:33 +0200 Subject: [PATCH] Gopher: Add like / repeat count. --- lib/pleroma/gopher/server.ex | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/gopher/server.ex b/lib/pleroma/gopher/server.ex index cccde155a..17741a7a7 100644 --- a/lib/pleroma/gopher/server.ex +++ b/lib/pleroma/gopher/server.ex @@ -71,8 +71,13 @@ def render_activities(activities) do |> Enum.map(fn activity -> user = User.get_cached_by_ap_id(activity.data["actor"]) + object = activity.data["object"] + like_count = object["like_count"] || 0 + announcement_count = object["announcement_count"] || 0 + link("Post ##{activity.id} by #{user.nickname}", "/notices/#{activity.id}") <> - info(HtmlSanitizeEx.strip_tags(activity.data["object"]["content"])) + info("#{like_count} likes, #{announcement_count} repeats") <> + "\r\n" <> info(HtmlSanitizeEx.strip_tags(activity.data["object"]["content"])) end) |> Enum.join("\r\n") end