]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
Fix for ticket #3010: blocks are now applied against the original poster of repeats.
[quix0rs-gnu-social.git] / 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]);
             }
         }