aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-08 18:26:35 +0200
committerlain <lain@soykaf.club>2020-05-08 18:26:35 +0200
commit03529f6a0528ed01c7a956bb80628910584a9580 (patch)
treea718c0e083e3d326695922294d38a05eb39edfae
parentd0bf8cfb8f852a16259af4b808565cdfd58f5e61 (diff)
downloadpleroma-03529f6a0528ed01c7a956bb80628910584a9580.tar.gz
Transmogrifier: Don't modify attachments for chats.
-rw-r--r--lib/pleroma/web/activity_pub/transmogrifier.ex3
-rw-r--r--test/web/common_api/common_api_test.exs2
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex
index 29f668cad..f04dec6be 100644
--- a/lib/pleroma/web/activity_pub/transmogrifier.ex
+++ b/lib/pleroma/web/activity_pub/transmogrifier.ex
@@ -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
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index 61affda5d..5501ba18b 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -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