aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoreal <eal@waifu.club>2017-11-18 15:25:22 +0200
committereal <eal@waifu.club>2017-11-18 15:25:22 +0200
commit31e4277ba5a2a793a0bc94f5d7682a48349583a3 (patch)
tree3aad314eca99a9e97c607e68203859f1a762055f /lib
parentfb118b2978686a44a15534b638ab7887fb38c03d (diff)
downloadpleroma-31e4277ba5a2a793a0bc94f5d7682a48349583a3.tar.gz
Don't add summary if empty.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/twitter_api/representers/activity_representer.ex5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/pleroma/web/twitter_api/representers/activity_representer.ex b/lib/pleroma/web/twitter_api/representers/activity_representer.ex
index 3fbeb86ba..b17013d87 100644
--- a/lib/pleroma/web/twitter_api/representers/activity_representer.ex
+++ b/lib/pleroma/web/twitter_api/representers/activity_representer.ex
@@ -135,8 +135,9 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
tags = activity.data["object"]["tag"] || []
possibly_sensitive = Enum.member?(tags, "nsfw")
- content = if activity.data["object"]["summary"] do
- "<span>#{activity.data["object"]["summary"]}</span><br>#{content}</span>"
+ summary = activity.data["object"]["summary"]
+ content = if !!summary and summary != "" do
+ "<span>#{activity.data["object"]["summary"]}</span><br />#{content}</span>"
else
content
end