[ActivityPub] Check if a Notice is public via CC as well

This commit is contained in:
Alexei Sorokin 2020-09-01 01:20:13 +03:00 committed by Diogo Peralta Cordeiro
parent 238652b15d
commit 6cb3a0c390

View File

@ -344,7 +344,8 @@ class Activitypub_notice
*/
public static function getNotePolicyType(array $note, Profile $actor_profile): int
{
if (in_array('https://www.w3.org/ns/activitystreams#Public', $note['to'])) {
$addressee = array_unique(array_merge($note['to'], $note['cc']));
if (in_array('https://www.w3.org/ns/activitystreams#Public', $addressee)) {
return $actor_profile->isLocal() ? Notice::LOCAL_PUBLIC : Notice::REMOTE;
} else {
// either an unlisted or followers-only note, we'll handle