From: Mikael Nordfeldth Date: Thu, 7 Jan 2016 22:33:47 +0000 (+0100) Subject: Default to not include delete verbs in notice streams X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e6f2676c5c6f3eea36eea6cce68c65cd84b9945e;p=quix0rs-gnu-social.git Default to not include delete verbs in notice streams --- diff --git a/lib/inboxnoticestream.php b/lib/inboxnoticestream.php index b5a8877d99..496fe0d05d 100644 --- a/lib/inboxnoticestream.php +++ b/lib/inboxnoticestream.php @@ -85,6 +85,7 @@ class RawInboxNoticeStream extends NoticeStream function __construct(Profile $target) { $this->target = $target; + $this->unselectVerbs = array(ActivityVerb::DELETE); } /** @@ -121,6 +122,9 @@ class RawInboxNoticeStream extends NoticeStream if (!empty($this->selectVerbs)) { $notice->whereAddIn('verb', $this->selectVerbs, $notice->columnType('verb')); } + if (!empty($this->unselectVerbs)) { + $notice->whereAddIn('!verb', $this->unselectVerbs, $notice->columnType('verb')); + } $notice->limit($offset, $limit); // notice.id will give us even really old posts, which were // recently imported. For example if a remote instance had diff --git a/lib/noticestream.php b/lib/noticestream.php index 0f53daf83f..3b597fa08c 100644 --- a/lib/noticestream.php +++ b/lib/noticestream.php @@ -46,12 +46,13 @@ if (!defined('STATUSNET')) { */ abstract class NoticeStream { - // Will only get notices with the 'post' activityverb by default. protected $selectVerbs = array(); + protected $unselectVerbs = array(); public function __construct() { $this->selectVerbs = array(ActivityVerb::POST, ActivityUtils::resolveUri(ActivityVerb::POST, true)); + $this->unselectVerbs = array(ActivityVerb::DELETE); } abstract function getNoticeIds($offset, $limit, $since_id, $max_id);