From a127041c8b3e31c9fa487dd5ca4faa29a0a59e6e Mon Sep 17 00:00:00 2001 From: dcc Date: Mon, 4 Sep 2023 02:54:35 -0700 Subject: move to 2.5.5 --- test/pleroma/web/common_api_test.exs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) mode change 100644 => 100755 test/pleroma/web/common_api_test.exs (limited to 'test/pleroma/web/common_api_test.exs') diff --git a/test/pleroma/web/common_api_test.exs b/test/pleroma/web/common_api_test.exs old mode 100644 new mode 100755 index 5c9103e..e606919 --- a/test/pleroma/web/common_api_test.exs +++ b/test/pleroma/web/common_api_test.exs @@ -279,6 +279,24 @@ defmodule Pleroma.Web.CommonAPITest do assert {:reject, "[KeywordPolicy] Matches with rejected keyword"} == CommonAPI.post_chat_message(author, recipient, "GNO/Linux") end + + test "it reject messages with attachments not belonging to user" do + author = insert(:user) + not_author = insert(:user) + recipient = author + + attachment = insert(:attachment, %{user: not_author}) + + {:error, message} = + CommonAPI.post_chat_message( + author, + recipient, + "123", + media_id: attachment.id + ) + + assert message == :forbidden + end end describe "unblocking" do -- cgit v1.2.3