aboutsummaryrefslogtreecommitdiff
path: root/test/web/common_api/common_api_test.exs
diff options
context:
space:
mode:
authorIvan Tashkinov <ivant.business@gmail.com>2019-04-02 09:19:10 +0300
committerIvan Tashkinov <ivant.business@gmail.com>2019-04-02 09:19:10 +0300
commitaac48d0cc6893c231c88d5cd7fe0334353bbf299 (patch)
treec3e423993ff5289dd0ba73a94881bd52d9cda1c2 /test/web/common_api/common_api_test.exs
parentf6fab01ba7a08fe0e5147f82d9e3dd294922dc93 (diff)
parentf8aa917eef9280631a5cd2c95cf1db8fab6e14e5 (diff)
downloadpleroma-aac48d0cc6893c231c88d5cd7fe0334353bbf299.tar.gz
Merge remote-tracking branch 'remotes/upstream/develop' into features/mastoapi/2.6.0-conversations
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r--test/web/common_api/common_api_test.exs18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index f83f80b40..34aa5bf18 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -10,6 +10,24 @@ defmodule Pleroma.Web.CommonAPITest do
import Pleroma.Factory
+ test "with the safe_dm_mention option set, it does not mention people beyond the initial tags" do
+ har = insert(:user)
+ jafnhar = insert(:user)
+ tridi = insert(:user)
+ option = Pleroma.Config.get([:instance, :safe_dm_mentions])
+ Pleroma.Config.put([:instance, :safe_dm_mentions], true)
+
+ {:ok, activity} =
+ CommonAPI.post(har, %{
+ "status" => "@#{jafnhar.nickname} hey, i never want to see @#{tridi.nickname} again",
+ "visibility" => "direct"
+ })
+
+ refute tridi.ap_id in activity.recipients
+ assert jafnhar.ap_id in activity.recipients
+ Pleroma.Config.put([:instance, :safe_dm_mentions], option)
+ end
+
test "it de-duplicates tags" do
user = insert(:user)
{:ok, activity} = CommonAPI.post(user, %{"status" => "#2hu #2HU"})