aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-20 13:38:47 +0200
committerlain <lain@soykaf.club>2020-05-20 13:38:47 +0200
commiteb5f4285651c923aa3d776a2bc317c2a902031cc (patch)
treeac51e0ceb40bcdd627f0f088f86c08788b6fef30 /lib/pleroma/web/common_api
parent94ba5a780212920a1d4b303c3523f66ca0147a67 (diff)
downloadpleroma-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 'lib/pleroma/web/common_api')
-rw-r--r--lib/pleroma/web/common_api/utils.ex3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex
index e8deee223..b9fa21648 100644
--- a/lib/pleroma/web/common_api/utils.ex
+++ b/lib/pleroma/web/common_api/utils.ex
@@ -102,7 +102,8 @@ defmodule Pleroma.Web.CommonAPI.Utils do
end
def get_to_and_cc(_user, mentioned_users, inReplyTo, "direct", _) do
- if inReplyTo do
+ # If the OP is a DM already, add the implicit actor.
+ if inReplyTo && Visibility.is_direct?(inReplyTo) do
{Enum.uniq([inReplyTo.data["actor"] | mentioned_users]), []}
else
{mentioned_users, []}