From: Philipp Date: Mon, 20 Jan 2020 22:51:07 +0000 (+0100) Subject: Merge pull request #8147 from annando/fetch-post X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ae2959c7805ae458b125f33e34f650c1520b4ccf;hp=-c;p=friendica.git Merge pull request #8147 from annando/fetch-post Fix for AP posts where the URL don't match --- ae2959c7805ae458b125f33e34f650c1520b4ccf diff --combined src/Model/Item.php index 38557c52ce,41c6eeb94d..47af3d5a69 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@@ -1856,18 -1856,7 +1856,18 @@@ class Ite } // Creates or assigns the permission set - $item['psid'] = PermissionSet::fetchIDForPost($item); + $item['psid'] = PermissionSet::getIdFromACL( + $item['uid'], + $item['allow_cid'], + $item['allow_gid'], + $item['deny_cid'], + $item['deny_gid'] + ); + + $item['allow_cid'] = null; + $item['allow_gid'] = null; + $item['deny_cid'] = null; + $item['deny_gid'] = null; // We are doing this outside of the transaction to avoid timing problems if (!self::insertActivity($item)) { @@@ -2740,13 -2729,7 +2740,13 @@@ $private = ($user['allow_cid'] || $user['allow_gid'] || $user['deny_cid'] || $user['deny_gid']) ? 1 : 0; - $psid = PermissionSet::fetchIDForPost($user); + $psid = PermissionSet::getIdFromACL( + $user['uid'], + $user['allow_cid'], + $user['allow_gid'], + $user['deny_cid'], + $user['deny_gid'] + ); $forum_mode = ($prvgroup ? 2 : 1); @@@ -3759,8 -3742,8 +3759,8 @@@ return $item_id; } - if (ActivityPub\Processor::fetchMissingActivity($uri)) { - $item_id = self::searchByLink($uri, $uid); + if ($fetched_uri = ActivityPub\Processor::fetchMissingActivity($uri)) { + $item_id = self::searchByLink($fetched_uri, $uid); } else { $item_id = Diaspora::fetchByURL($uri); }