Merge branch 'bugfix/unshared-inbox-check' into 'develop'
authorkaniini <nenolod@gmail.com>
Fri, 26 Oct 2018 01:36:07 +0000 (01:36 +0000)
committerkaniini <nenolod@gmail.com>
Fri, 26 Oct 2018 01:36:07 +0000 (01:36 +0000)
activitypub utils: fix recipient check when the message is unaddressed (mastodon)

See merge request pleroma/pleroma!392

lib/pleroma/web/activity_pub/utils.ex

index 266667f8109720ee05ae35374800147eaddf3b31..d6ac2dd8c294c0af345500a061aca89ec2f8c3cb 100644 (file)
@@ -37,6 +37,11 @@ defmodule Pleroma.Web.ActivityPub.Utils 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