]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
since_id and max_id for RawInboxNoticeStream
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 7 May 2014 09:50:20 +0000 (11:50 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 7 May 2014 09:50:40 +0000 (11:50 +0200)
Otherwise you could only fetch a strict limit since the latest notice.

lib/inboxnoticestream.php

index 57c5e0c80e029e565a381e109286220e7a9d51e2..481634b32f3873f81775fd6dcb30e5e0f0061460 100644 (file)
@@ -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');