activitypub utils: fix recipient check when the message is unaddressed (mastodon)

This commit is contained in:
William Pitcock 2018-10-26 01:24:22 +00:00
parent 72031e80d7
commit f6cb963df2
1 changed files with 5 additions and 0 deletions

View File

@ -37,6 +37,11 @@ def recipient_in_message(ap_id, params) do
recipient_in_collection(ap_id, params["bcc"]) -> recipient_in_collection(ap_id, params["bcc"]) ->
true 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 -> true ->
false false
end end