summaryrefslogtreecommitdiff
path: root/test/web/common_api/common_api_test.exs
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-05-22 05:22:07 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-05-22 05:22:07 +0000
commita57e7f3503c485de64c4e001529a6e06a1a35b25 (patch)
tree002c88269701a94dbc181fa39524a5476e550494 /test/web/common_api/common_api_test.exs
parente0d1a942a6e561a889615f6387ce3c340dadfa21 (diff)
parenteb5f4285651c923aa3d776a2bc317c2a902031cc (diff)
downloadpleroma-a57e7f3503c485de64c4e001529a6e06a1a35b25.tar.gz
pleroma-a57e7f3503c485de64c4e001529a6e06a1a35b25.zip
Merge branch '1113-op-mentioning' into 'develop'
CommonAPI: Change public->private implicit addressing. Closes #1113 See merge request pleroma/pleroma!2563
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r--test/web/common_api/common_api_test.exs26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index 52e95397c..6014ffdac 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -335,6 +335,32 @@ defmodule Pleroma.Web.CommonAPITest do
end)
end
+ test "replying with a direct message will NOT auto-add the author of the reply to the recipient list" do
+ user = insert(:user)
+ other_user = insert(:user)
+ third_user = insert(:user)
+
+ {:ok, post} = CommonAPI.post(user, %{status: "I'm stupid"})
+
+ {:ok, open_answer} =
+ CommonAPI.post(other_user, %{status: "No ur smart", in_reply_to_status_id: post.id})
+
+ # The OP is implicitly added
+ assert user.ap_id in open_answer.recipients
+
+ {:ok, secret_answer} =
+ CommonAPI.post(other_user, %{
+ status: "lol, that guy really is stupid, right, @#{third_user.nickname}?",
+ in_reply_to_status_id: post.id,
+ visibility: "direct"
+ })
+
+ assert third_user.ap_id in secret_answer.recipients
+
+ # The OP is not added
+ refute user.ap_id in secret_answer.recipients
+ end
+
test "it allows to address a list" do
user = insert(:user)
{:ok, list} = Pleroma.List.create("foo", user)