Don't add summary if empty.
authoreal <eal@waifu.club>
Sat, 18 Nov 2017 13:25:22 +0000 (15:25 +0200)
committereal <eal@waifu.club>
Sat, 18 Nov 2017 13:25:22 +0000 (15:25 +0200)
lib/pleroma/web/twitter_api/representers/activity_representer.ex

index 3fbeb86ba94c50c8438a9eab65e28bcd2407b643..b17013d875141c255b4b4a98a7d1e27106f5bd22 100644 (file)
@@ -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