From 04f71a42d397fe4ed2737f64844925894ecbd7db Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 31 Dec 2011 09:15:32 -0800 Subject: [PATCH] when silencing, blow scope for not-logged-in users --- classes/Profile.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/classes/Profile.php b/classes/Profile.php index 3b3e43025b..59a2e0eced 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -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)); + } } /**