From e35d46b415f89b19a4e3c1f5b4f077253434330b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 24 Jan 2011 14:16:15 -0800 Subject: [PATCH] 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. --- classes/Notice.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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]); } } -- 2.39.5