]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Default to not include delete verbs in notice streams
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 7 Jan 2016 22:33:47 +0000 (23:33 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 7 Jan 2016 22:33:47 +0000 (23:33 +0100)
lib/inboxnoticestream.php
lib/noticestream.php

index b5a8877d99d426a9a425c4952ea6ef1d9d3a0c61..496fe0d05d5425f6c784a0cf448b4fe34e4bb52d 100644 (file)
@@ -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
index 0f53daf83f407e15a878d747d1268b972eb451c9..3b597fa08cf03899ca42406084fad93dc5c99d8b 100644 (file)
@@ -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);