1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class ModeratedNoticeStream extends ScopingNoticeStream
- {
- protected function filter(Notice $notice)
- {
- if (!parent::filter($notice)) {
- return false;
- }
-
- if(self::include_or_not($notice) === false) {
- return false;
- }
-
-
- if($notice->isRepeat()) {
- try {
- $repeated_notice = Notice::getById($notice->repeat_of);
- } catch (Exception $e) {
-
- return false;
- }
- if(self::include_or_not($repeated_notice) === false) {
- return false;
- }
- }
- return true;
- }
-
- protected function include_or_not(Notice $notice)
- {
- $profile = $notice->getProfile();
- if ($profile->isSandboxed()) {
- if (!$this->scoped instanceof Profile) {
-
- return false;
- } elseif (!$profile->sameAs($this->scoped) && !$this->scoped->hasRight(Right::REVIEWSPAM)) {
-
- return false;
- }
- }
- }
- }
|