From: Mikael Nordfeldth Date: Wed, 7 May 2014 09:50:20 +0000 (+0200) Subject: since_id and max_id for RawInboxNoticeStream X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=de5049bf1559abdfdaf60d87d31eb135df5afaac;p=quix0rs-gnu-social.git since_id and max_id for RawInboxNoticeStream Otherwise you could only fetch a strict limit since the latest notice. --- diff --git a/lib/inboxnoticestream.php b/lib/inboxnoticestream.php index 57c5e0c80e..481634b32f 100644 --- a/lib/inboxnoticestream.php +++ b/lib/inboxnoticestream.php @@ -112,6 +112,12 @@ class RawInboxNoticeStream extends NoticeStream 'OR notice.id IN (SELECT notice_id FROM attention WHERE profile_id=%1$d)', $this->target->id) ); + if (!empty($since_id)) { + $notice->whereAdd(sprintf('notice.id > %d', $since_id)); + } + if (!empty($max_id)) { + $notice->whereAdd(sprintf('notice.id <= %d', $max_id)); + } $notice->limit($offset, $limit); $notice->orderBy('notice.created DESC');