From 88f3e690c3c34e7c033afbd7bc7734bbec316b2f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 22 Mar 2012 11:37:45 -0400 Subject: [PATCH] flush anonymous scope when a profile is silenced --- classes/Profile.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/classes/Profile.php b/classes/Profile.php index 3b3e43025b..e07d37139b 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -1139,11 +1139,27 @@ class Profile extends Managed_DataObject function silence() { $this->grantRole(Profile_role::SILENCED); + if (common_config('notice', 'hidespam')) { + $this->flushVisibility(); + } } function unsilence() { $this->revokeRole(Profile_role::SILENCED); + if (common_config('notice', 'hidespam')) { + $this->flushVisibility(); + } + } + + function flushVisibility() + { + // Get all notices + $stream = new ProfileNoticeStream($this, $this); + $ids = $stream->getNoticeIds(0, CachingNoticeStream::CACHE_WINDOW); + foreach ($ids as $id) { + self::blow('notice:in-scope-for:%d:null', $id); + } } /** -- 2.39.5