From: Michael Vogel Date: Fri, 29 Dec 2023 23:51:41 +0000 (+0100) Subject: Remove 'blocklist' pconfig functionality (#13780) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0c68a53e1e86ef6d7a3faf236267df576f976647;p=friendica.git Remove 'blocklist' pconfig functionality (#13780) * Cache blocklist * Remove 'blocklist' pconfig functionality * The blocklist variable isn't used anymore --- diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index deecc6c224..303850d9d9 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -658,10 +658,6 @@ class Conversation * But for now, this array respects the old style, just in case */ foreach ($items as $item) { - if (in_array($item['author-id'], $this->getBlocklist())) { - continue; - } - // Can we put this after the visibility check? $this->builtinActivityPuller($item, $conv_responses); @@ -696,33 +692,6 @@ class Conversation return $threads; } - private function getBlocklist(): array - { - if (!$this->session->getLocalUserId()) { - return []; - } - - if (!empty($this->blockList)) { - return $this->blockList; - } - - $str_blocked = str_replace(["\n", "\r"], ",", $this->pConfig->get($this->session->getLocalUserId(), 'system', 'blocked') ?? ''); - if (empty($str_blocked)) { - return []; - } - - $this->blockList = []; - - foreach (explode(',', $str_blocked) as $entry) { - $cid = Contact::getIdForURL(trim($entry), 0, false); - if (!empty($cid)) { - $this->blockList[] = $cid; - } - } - - return $this->blockList; - } - /** * Adds some information (Causer, post reason, direction) to the fetched post row. * @@ -1280,16 +1249,10 @@ class Conversation return $parents; } - $blocklist = $this->getBlocklist(); - $item_array = []; // Dedupes the item list on the uri to prevent infinite loops foreach ($item_list as $item) { - if (in_array($item['author-id'], $blocklist)) { - continue; - } - $item_array[$item['uri-id']] = $item; } @@ -1478,10 +1441,6 @@ class Conversation continue; } - if (in_array($item['author-id'], $this->getBlocklist())) { - continue; - } - // prevent private email from leaking. if ($item['network'] === Protocol::MAIL && $this->session->getLocalUserId() != $item['uid']) { continue;