forked from GNUsocial/gnu-social
flush anonymous scope when a profile is silenced
This commit is contained in:
parent
7e76d116d8
commit
88f3e690c3
@ -1139,11 +1139,27 @@ class Profile extends Managed_DataObject
|
|||||||
function silence()
|
function silence()
|
||||||
{
|
{
|
||||||
$this->grantRole(Profile_role::SILENCED);
|
$this->grantRole(Profile_role::SILENCED);
|
||||||
|
if (common_config('notice', 'hidespam')) {
|
||||||
|
$this->flushVisibility();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function unsilence()
|
function unsilence()
|
||||||
{
|
{
|
||||||
$this->revokeRole(Profile_role::SILENCED);
|
$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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user