activity interpretation: formatting
authorWilliam Pitcock <nenolod@dereferenced.org>
Sun, 24 Jun 2018 06:34:44 +0000 (06:34 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Wed, 27 Jun 2018 13:38:19 +0000 (13:38 +0000)
lib/pleroma/web/activity_pub/transmogrifier.ex
lib/pleroma/web/mastodon_api/views/status_view.ex
lib/pleroma/web/twitter_api/views/activity_view.ex

index 1b60170d9aa4294b40d3451bb139dbc5b1bce98f..59c4b90e7d89096aef27d3daaf4c5a0dd953df75 100644 (file)
@@ -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"])
index f7ad87badc70b6ed699517add2848eb8315d0df2..6b48c41c168d099b0bc154791e3e50565780156d 100644 (file)
@@ -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"]}"
index 0779872fe2f122b337c410b6200ca7f5fdaad5df..f418249e2d616c9539b9f1ba115effcb93fac6ce 100644 (file)
@@ -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"]}"