From: lain Date: Sat, 31 Mar 2018 16:22:33 +0000 (+0200) Subject: Gopher: Add like / repeat count. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=57b24b2cbaba9a85a715a311db31654995232b10;p=akkoma Gopher: Add like / repeat count. --- 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 @@ defmodule Pleroma.Gopher.Server.ProtocolHandler 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