Skip to content
Snippets Groups Projects
Commit 20403c00 authored by Vivian Lim's avatar Vivian Lim Committed by Vivian Lim
Browse files

Expose content & summary separately from activity_view api

parent beb940a5
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -231,22 +231,26 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
summary = activity.data["object"]["summary"]
content = object["content"]
content =
summary =
if !!summary and summary != "" do
"<span>#{activity.data["object"]["summary"]}</span><br />#{content}</span>"
HtmlSanitizeEx.strip_tags(summary)
else
content
""
end
html =
HtmlSanitizeEx.basic_html(content)
|> Formatter.emojify(object["emoji"])
combined_html = "<div>#{summary}</div><div>#{html}</div>"
%{
"id" => activity.id,
"uri" => activity.data["object"]["id"],
"user" => UserView.render("show.json", %{user: user, for: opts[:for]}),
"statusnet_html" => html,
"statusnet_html" => combined_html,
"content" => html,
"summary" => summary,
"text" => HtmlSanitizeEx.strip_tags(content),
"is_local" => activity.local,
"is_post_verb" => true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment