From: Brion Vibber Date: Mon, 24 Jan 2011 22:16:15 +0000 (-0800) Subject: Fix for ticket #3010: blocks are now applied against the original poster of repeats. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e35d46b415f89b19a4e3c1f5b4f077253434330b;p=quix0rs-gnu-social.git Fix for ticket #3010: blocks are now applied against the original poster of repeats. Previously, if someone you subscribe to repeats a notice by someone you've blocked, you got the message and had to just roll your eyes. Now blocks are checked against both the current notice's posting profile, and the poster of the original if it's a repeat. --- diff --git a/classes/Notice.php b/classes/Notice.php index 561999966c..0910ba39b7 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -819,9 +819,18 @@ class Notice extends Memcached_DataObject // Exclude any deleted, non-local, or blocking recipients. $profile = $this->getProfile(); + $originalProfile = null; + if ($this->repeat_of) { + // Check blocks against the original notice's poster as well. + $original = Notice::staticGet('id', $this->repeat_of); + if ($original) { + $originalProfile = $original->getProfile(); + } + } foreach ($ni as $id => $source) { $user = User::staticGet('id', $id); - if (empty($user) || $user->hasBlocked($profile)) { + if (empty($user) || $user->hasBlocked($profile) || + ($originalProfile && $user->hasBlocked($originalProfile))) { unset($ni[$id]); } }