summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2019-01-27 12:27:37 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2019-01-28 05:53:17 +0000
commit07a9a891ad93d7fb21d596deb5211b4570cf1acb (patch)
treed5846edd1cf37f0a17ff3873a65e5df6323b6c9d
parent364cf5369b711e15b9ec60c768dadc280969a962 (diff)
downloadpleroma-07a9a891ad93d7fb21d596deb5211b4570cf1acb.tar.gz
pleroma-07a9a891ad93d7fb21d596deb5211b4570cf1acb.zip
twitter api: fix up activity representer
-rw-r--r--lib/pleroma/web/twitter_api/representers/activity_representer.ex7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/pleroma/web/twitter_api/representers/activity_representer.ex b/lib/pleroma/web/twitter_api/representers/activity_representer.ex
index 19b723586..364aa7af3 100644
--- a/lib/pleroma/web/twitter_api/representers/activity_representer.ex
+++ b/lib/pleroma/web/twitter_api/representers/activity_representer.ex
@@ -12,6 +12,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Formatter
alias Pleroma.HTML
+ alias Pleroma.Web.MastodonAPI
+ alias Pleroma.Web.MastodonAPI.StatusView
defp user_by_ap_id(user_list, ap_id) do
Enum.find(user_list, fn %{ap_id: user_id} -> ap_id == user_id end)
@@ -186,6 +188,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
summary = HTML.strip_tags(object["summary"])
+ card = StatusView.render("card.json", MastodonAPI.get_status_card(activity.id))
+
%{
"id" => activity.id,
"uri" => activity.data["object"]["id"],
@@ -214,7 +218,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
"possibly_sensitive" => possibly_sensitive,
"visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object),
"summary" => summary,
- "summary_html" => summary |> Formatter.emojify(object["emoji"])
+ "summary_html" => summary |> Formatter.emojify(object["emoji"]),
+ "card" => card
}
end