summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2018-06-24 06:30:23 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2018-06-27 13:38:07 +0000
commit66819ea784509fbed3f7db8056ececf150339b35 (patch)
treeaf7cbfcf98339cff8ebddaba9dd67796cfff9b6c /lib
parentea982e7503767f645dc26235e04c541ce976de71 (diff)
downloadpleroma-66819ea784509fbed3f7db8056ececf150339b35.tar.gz
pleroma-66819ea784509fbed3f7db8056ececf150339b35.zip
twitter api: use ActivityView.render_content() where appropriate instead of duplicating the logic
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/twitter_api/representers/activity_representer.ex11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/pleroma/web/twitter_api/representers/activity_representer.ex b/lib/pleroma/web/twitter_api/representers/activity_representer.ex
index 57837205e..bb77e61f3 100644
--- a/lib/pleroma/web/twitter_api/representers/activity_representer.ex
+++ b/lib/pleroma/web/twitter_api/representers/activity_representer.ex
@@ -4,7 +4,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
use Pleroma.Web.TwitterAPI.Representers.BaseRepresenter
alias Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter
alias Pleroma.{Activity, User}
- alias Pleroma.Web.TwitterAPI.{TwitterAPI, UserView}
+ alias Pleroma.Web.TwitterAPI.{TwitterAPI, UserView, ActivityView}
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Formatter
@@ -164,14 +164,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
tags = if possibly_sensitive, do: Enum.uniq(["nsfw" | tags]), else: tags
- summary = activity.data["object"]["summary"]
-
- content =
- if !!summary and summary != "" do
- "<span>#{activity.data["object"]["summary"]}</span><br />#{content}</span>"
- else
- content
- end
+ {summary, content} = ActivityView.render_content(object)
html =
HtmlSanitizeEx.basic_html(content)