3 if (!defined('GNUSOCIAL')) { exit(1); }
6 * Moderated notice stream, will take into account the scoping of
7 * notices as well as whether the profile is moderated somehow,
8 * such as by sandboxing or silencing.
10 * Inherits $this->scoped from ScopingNoticeStream as the Profile
11 * this stream is meant for. Can be null in case we're not logged in.
15 * @author Mikael Nordfeldth <mmn@hethane.se>
16 * @copyright 2016 Free Software Foundation, Inc.
17 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
18 * @link https://gnu.io/social
21 class ModeratedNoticeStream extends ScopingNoticeStream
23 protected function filter(Notice $notice)
25 if (!parent::filter($notice)) {
29 // If the notice author is sandboxed
30 if ($notice->getProfile()->isSandboxed()) {
31 // and we're either not logged in OR we aren't some kind of privileged user that can see spam etc.
32 if (!$this->scoped instanceof Profile || !$this->scoped->hasRight(Right::REVIEWSPAM)) {