Transmogrifier: Don't modify attachments for chats.
authorlain <lain@soykaf.club>
Fri, 8 May 2020 16:26:35 +0000 (18:26 +0200)
committerlain <lain@soykaf.club>
Fri, 8 May 2020 16:26:35 +0000 (18:26 +0200)
lib/pleroma/web/activity_pub/transmogrifier.ex
test/web/common_api/common_api_test.exs

index 29f668cadbb0d6098738e4b56dc8c00500162d36..f04dec6be6b971e800c76da22d0ce10803943367 100644 (file)
@@ -1114,6 +1114,9 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
     Map.put(object, "attributedTo", attributed_to)
   end
 
+  # TODO: Revisit this
+  def prepare_attachments(%{"type" => "ChatMessage"} = object), do: object
+
   def prepare_attachments(object) do
     attachments =
       object
index 61affda5dec0c6c18c3d20ca41a30024511a4905..5501ba18bde0154b52edef29195930f0491bdfca 100644 (file)
@@ -54,6 +54,8 @@ defmodule Pleroma.Web.CommonAPITest do
 
       assert Chat.get(author.id, recipient.ap_id)
       assert Chat.get(recipient.id, author.ap_id)
+
+      assert :ok == Pleroma.Web.Federator.perform(:publish, activity)
     end
 
     test "it reject messages over the local limit" do