]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
Merge branch 'master' into 1.1.x
[quix0rs-gnu-social.git] / classes / Notice.php
index a7c678e1cf595186504734e865dd3fbab98bdef5..a813db99b3b234a8ab8a057a4a6f1084c4da689a 100644 (file)
@@ -645,7 +645,7 @@ class Notice extends Managed_DataObject
         }
 
         self::blow('notice:list-ids:conversation:%s', $this->conversation);
-        self::blow('conversation::notice_count:%d', $this->conversation);
+        self::blow('conversation:notice_count:%d', $this->conversation);
 
         if (!empty($this->repeat_of)) {
             // XXX: we should probably only use one of these
@@ -1008,10 +1008,7 @@ class Notice extends Managed_DataObject
                 $users = $ptag->getUserSubscribers();
                 foreach ($users as $id) {
                     if (!array_key_exists($id, $ni)) {
-                        $user = User::staticGet('id', $id);
-                        if (!$user->hasBlocked($profile)) {
-                            $ni[$id] = NOTICE_INBOX_SOURCE_PROFILE_TAG;
-                        }
+                        $ni[$id] = NOTICE_INBOX_SOURCE_PROFILE_TAG;
                     }
                 }
             }
@@ -1020,23 +1017,24 @@ class Notice extends Managed_DataObject
                 if (!array_key_exists($recipient, $ni)) {
                     $ni[$recipient] = NOTICE_INBOX_SOURCE_REPLY;
                 }
+            }
 
-                // 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();
-                    }
+            // 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) ||
-                        ($originalProfile && $user->hasBlocked($originalProfile))) {
-                        unset($ni[$id]);
-                    }
+            }
+
+            foreach ($ni as $id => $source) {
+                $user = User::staticGet('id', $id);
+                if (empty($user) || $user->hasBlocked($profile) ||
+                    ($originalProfile && $user->hasBlocked($originalProfile))) {
+                    unset($ni[$id]);
                 }
             }
 
@@ -2474,7 +2472,7 @@ class Notice extends Managed_DataObject
             $author = $this->getProfile();
 
             if ($author->hasRole(Profile_role::SILENCED)) {
-                if (empty($profile) || !$profile->hasRole(Profile_role::MODERATOR)) {
+                if (empty($profile) || !$profile->hasRight(Right::REVIEWSPAM)) {
                     return true;
                 }
             }