Merge branch 'hotfix/prismo-twitterapi' into 'develop'
[akkoma] / lib / pleroma / web / twitter_api / views / activity_view.ex
index fb97f199bcde8a9a444754350fe9bb26df719825..83e8fb765b3d4a3cd1a735763b3cfd467258d372 100644 (file)
@@ -283,11 +283,11 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
     {summary, content}
   end
 
-  def render_content(%{"type" => "Article"} = object) do
+  def render_content(%{"type" => object_type} = object) when object_type in ["Article", "Page"] do
     summary = object["name"] || object["summary"]
 
     content =
-      if !!summary and summary != "" do
+      if !!summary and summary != "" and is_bitstring(object["url"]) do
         "<p><a href=\"#{object["url"]}\">#{summary}</a></p>#{object["content"]}"
       else
         object["content"]