Move expand_acl to ACLFormatter::expand()

- including tests
This commit is contained in:
Philipp Holzer 2019-10-23 00:40:14 +02:00
parent 7a9c5d10ee
commit f65f7f11c3
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
8 changed files with 224 additions and 160 deletions

View file

@ -24,6 +24,7 @@ use Friendica\Protocol\ActivityPub;
use Friendica\Protocol\Diaspora;
use Friendica\Protocol\OStatus;
use Friendica\Protocol\Salmon;
use Friendica\Util\ACLFormatter;
require_once 'include/items.php';
@ -272,10 +273,13 @@ class Notifier
$public_message = false; // private recipients, not public
}
$allow_people = expand_acl($parent['allow_cid']);
$allow_groups = Group::expand($uid, expand_acl($parent['allow_gid']),true);
$deny_people = expand_acl($parent['deny_cid']);
$deny_groups = Group::expand($uid, expand_acl($parent['deny_gid']));
/** @var ACLFormatter $aclFormatter */
$aclFormatter = BaseObject::getClass(ACLFormatter::class);
$allow_people = $aclFormatter->expand($parent['allow_cid']);
$allow_groups = Group::expand($uid, $aclFormatter->expand($parent['allow_gid']),true);
$deny_people = $aclFormatter->expand($parent['deny_cid']);
$deny_groups = Group::expand($uid, $aclFormatter->expand($parent['deny_gid']));
// if our parent is a public forum (forum_mode == 1), uplink to the origional author causing
// a delivery fork. private groups (forum_mode == 2) do not uplink