From f6cb963df208a1f24aa195fda4ed894caac9e7bc Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 26 Oct 2018 01:24:22 +0000 Subject: [PATCH] activitypub utils: fix recipient check when the message is unaddressed (mastodon) --- lib/pleroma/web/activity_pub/utils.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/pleroma/web/activity_pub/utils.ex b/lib/pleroma/web/activity_pub/utils.ex index 266667f81..d6ac2dd8c 100644 --- a/lib/pleroma/web/activity_pub/utils.ex +++ b/lib/pleroma/web/activity_pub/utils.ex @@ -37,6 +37,11 @@ def recipient_in_message(ap_id, params) do recipient_in_collection(ap_id, params["bcc"]) -> true + # if the message is unaddressed at all, then assume it is directly addressed + # to the recipient + !params["to"] && !params["cc"] && !params["bto"] && !params["bcc"] -> + true + true -> false end