From 5d895093fd26ce0884957664c1214a66f5a36195 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 27 Jan 2019 12:16:08 +0000 Subject: [PATCH] twitter api: embed card in twitterapi posts --- lib/pleroma/web/twitter_api/views/activity_view.ex | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/web/twitter_api/views/activity_view.ex b/lib/pleroma/web/twitter_api/views/activity_view.ex index a01ee0010..77e9af348 100644 --- a/lib/pleroma/web/twitter_api/views/activity_view.ex +++ b/lib/pleroma/web/twitter_api/views/activity_view.ex @@ -10,6 +10,8 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do alias Pleroma.Web.TwitterAPI.ActivityView alias Pleroma.Web.TwitterAPI.TwitterAPI alias Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter + alias Pleroma.Web.MastodonAPI + alias Pleroma.Web.MastodonAPI.StatusView alias Pleroma.Activity alias Pleroma.HTML alias Pleroma.Object @@ -274,6 +276,8 @@ def render( summary = HTML.strip_tags(summary) + card = StatusView.render("card.json", MastodonAPI.get_status_card(activity.id)) + %{ "id" => activity.id, "uri" => activity.data["object"]["id"], @@ -300,9 +304,10 @@ def render( "tags" => tags, "activity_type" => "post", "possibly_sensitive" => possibly_sensitive, - "visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object), + "visibility" => StatusView.get_visibility(object), "summary" => summary, - "summary_html" => summary |> Formatter.emojify(object["emoji"]) + "summary_html" => summary |> Formatter.emojify(object["emoji"]), + "card" => card } end