]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
when silencing, blow scope for not-logged-in users
authorEvan Prodromou <evan@status.net>
Sat, 31 Dec 2011 17:15:32 +0000 (09:15 -0800)
committerEvan Prodromou <evan@status.net>
Sat, 31 Dec 2011 17:15:32 +0000 (09:15 -0800)
classes/Profile.php

index 3b3e43025ba7189b0c1f3ce558bdd0cd0bc8d483..59a2e0eced0e4c4942ef8c553e40f385c0ec0751 100644 (file)
@@ -1139,11 +1139,20 @@ class Profile extends Managed_DataObject
     function silence()
     {
         $this->grantRole(Profile_role::SILENCED);
+        $this->blowRecentNoticeScope();
     }
 
     function unsilence()
     {
         $this->revokeRole(Profile_role::SILENCED);
+        $this->blowRecentNoticeScope();
+    }
+
+    function blowRecentNoticeScope() {
+        $notice = $this->getNotices(0, CachingNoticeStream::CACHE_WINDOW);
+        while ($notice->fetch()) {
+            self::blow(sprintf('notice:in-scope-for:%d:null', $notice->id));
+        }        
     }
 
     /**