Merge pull request #10929 from MrPetovan/bug/notices

Test item psid against PermissionSet::PUBLIC constant instead in ActivityPub\Objects
This commit is contained in:
Philipp 2021-10-25 06:13:15 +02:00 committed by GitHub
commit 3921bd06cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,7 @@ use Friendica\Model\Item;
use Friendica\Model\Post; use Friendica\Model\Post;
use Friendica\Network\HTTPException; use Friendica\Network\HTTPException;
use Friendica\Protocol\ActivityPub; use Friendica\Protocol\ActivityPub;
use Friendica\Security\PermissionSet\Repository\PermissionSet;
use Friendica\Util\HTTPSignature; use Friendica\Util\HTTPSignature;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Util\Strings; use Friendica\Util\Strings;
@ -84,11 +85,8 @@ class Objects extends BaseModule
$requester_id = Contact::getIdForURL($requester, $item['uid']); $requester_id = Contact::getIdForURL($requester, $item['uid']);
if (!empty($requester_id)) { if (!empty($requester_id)) {
$permissionSets = DI::permissionSet()->selectByContactId($requester_id, $item['uid']); $permissionSets = DI::permissionSet()->selectByContactId($requester_id, $item['uid']);
if (!empty($permissionSets)) { $psids = array_merge($permissionSets->column('id'), [PermissionSet::PUBLIC]);
$psid = array_merge($permissionSets->column('id'), $validated = in_array($item['psid'], $psids);
[DI::permissionSet()->selectPublicForUser($item['uid'])]);
$validated = in_array($item['psid'], $psid);
}
} }
} }
} }