align code with newer GNU social

This commit is contained in:
Mikael Nordfeldth 2016-02-14 20:26:00 +01:00
parent bdc9eb8aae
commit 2a75c0b31c

View File

@ -453,9 +453,17 @@ class RawInboxNoticeStreamHiddenReplies extends NoticeStream
if (!empty($max_id)) { if (!empty($max_id)) {
$notice->whereAdd(sprintf('notice.id <= %d', $max_id)); $notice->whereAdd(sprintf('notice.id <= %d', $max_id));
} }
if (!empty($this->selectVerbs)) {
// We have changed how selectVerbs work in GNUsocial, so it's an associative array
// where each verb is in the key and then the value (true/false) is how to filter.
// $this->unselectVerbs is always unset in newer GNUsocials.
if (!isset($this->unselectVerbs)) {
self::filterVerbs($notice, $this->selectVerbs);
} elseif (!empty($this->selectVerbs)) {
// old behaviour was just if there were selectVerbs set
$notice->whereAddIn('verb', $this->selectVerbs, $notice->columnType('verb')); $notice->whereAddIn('verb', $this->selectVerbs, $notice->columnType('verb'));
} }
$notice->limit($offset, $limit); $notice->limit($offset, $limit);
// notice.id will give us even really old posts, which were // notice.id will give us even really old posts, which were
// recently imported. For example if a remote instance had // recently imported. For example if a remote instance had