diff options
author | lain <lain@soykaf.club> | 2020-05-20 13:38:47 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-20 13:38:47 +0200 |
commit | eb5f4285651c923aa3d776a2bc317c2a902031cc (patch) | |
tree | ac51e0ceb40bcdd627f0f088f86c08788b6fef30 /test/web/common_api/common_api_utils_test.exs | |
parent | 94ba5a780212920a1d4b303c3523f66ca0147a67 (diff) | |
download | pleroma-eb5f4285651c923aa3d776a2bc317c2a902031cc.tar.gz |
CommonAPI: Change public->private implicit addressing.
This will not add the OP to the `to` field anymore when going from
public to private.
Diffstat (limited to 'test/web/common_api/common_api_utils_test.exs')
-rw-r--r-- | test/web/common_api/common_api_utils_test.exs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/web/common_api/common_api_utils_test.exs b/test/web/common_api/common_api_utils_test.exs index 5708db6a4..d7d2d10d5 100644 --- a/test/web/common_api/common_api_utils_test.exs +++ b/test/web/common_api/common_api_utils_test.exs @@ -297,11 +297,10 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do {to, cc} = Utils.get_to_and_cc(user, mentions, activity, "private", nil) - assert length(to) == 3 + assert length(to) == 2 assert Enum.empty?(cc) assert mentioned_user.ap_id in to - assert third_user.ap_id in to assert user.follower_address in to end @@ -327,6 +326,15 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do {to, cc} = Utils.get_to_and_cc(user, mentions, activity, "direct", nil) + assert length(to) == 1 + assert Enum.empty?(cc) + + assert mentioned_user.ap_id in to + + {:ok, direct_activity} = CommonAPI.post(third_user, %{status: "uguu", visibility: "direct"}) + + {to, cc} = Utils.get_to_and_cc(user, mentions, direct_activity, "direct", nil) + assert length(to) == 2 assert Enum.empty?(cc) |