]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix for ticket #3010: blocks are now applied against the original poster of repeats.
authorBrion Vibber <brion@pobox.com>
Mon, 24 Jan 2011 22:16:15 +0000 (14:16 -0800)
committerBrion Vibber <brion@pobox.com>
Mon, 24 Jan 2011 22:16:15 +0000 (14:16 -0800)
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

index 561999966c5842bb3ad2df84beae942d2e8d1416..0910ba39b7c650b501402569c65b11368970df8e 100644 (file)
@@ -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]);
             }
         }