activitypub utils: fix recipient check when the message is unaddressed (mastodon)
authorWilliam Pitcock <nenolod@dereferenced.org>
Fri, 26 Oct 2018 01:24:22 +0000 (01:24 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Fri, 26 Oct 2018 01:24:22 +0000 (01:24 +0000)
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