diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/pleroma/web/activity_pub/transmogrifier.ex | 3 | ||||
| -rw-r--r-- | lib/pleroma/web/mastodon_api/views/status_view.ex | 1 | ||||
| -rw-r--r-- | lib/pleroma/web/twitter_api/views/activity_view.ex | 2 | 
3 files changed, 5 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 1b60170d9..59c4b90e7 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -122,7 +122,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do    # TODO: validate those with a Ecto scheme    # - tags    # - emoji -  def handle_incoming(%{"type" => "Create", "object" => %{"type" => objtype} = object} = data) when objtype in ["Article", "Note"] do +  def handle_incoming(%{"type" => "Create", "object" => %{"type" => objtype} = object} = data) +      when objtype in ["Article", "Note"] do      with nil <- Activity.get_create_activity_by_object_ap_id(object["id"]),           %User{} = user <- User.get_or_fetch_by_ap_id(data["actor"]) do        object = fix_object(data["object"]) diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index f7ad87bad..6b48c41c1 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -210,6 +210,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do    def render_content(%{"type" => "Article"} = object) do      summary = object["name"] +      content =        if !!summary and summary != "" do          "<p><a href=\"#{object["url"]}\">#{summary}</a></p>#{object["content"]}" diff --git a/lib/pleroma/web/twitter_api/views/activity_view.ex b/lib/pleroma/web/twitter_api/views/activity_view.ex index 0779872fe..f418249e2 100644 --- a/lib/pleroma/web/twitter_api/views/activity_view.ex +++ b/lib/pleroma/web/twitter_api/views/activity_view.ex @@ -261,6 +261,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do    def render_content(%{"type" => "Note"} = object) do      summary = object["summary"] +      content =        if !!summary and summary != "" do          "<p>#{summary}</p>#{object["content"]}" @@ -273,6 +274,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do    def render_content(%{"type" => "Article"} = object) do      summary = object["name"] || object["summary"] +      content =        if !!summary and summary != "" do          "<p><a href=\"#{object["url"]}\">#{summary}</a></p>#{object["content"]}"  | 
