1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- defined('GNUSOCIAL') || die();
- class ConversationNoticeStream extends ScopingNoticeStream
- {
- public function __construct($id, Profile $scoped = null)
- {
- parent::__construct(
- new RawConversationNoticeStream($id),
- $scoped
- );
- }
- }
- class RawConversationNoticeStream extends NoticeStream
- {
- protected $id;
- public function __construct($id)
- {
- parent::__construct();
- $this->id = $id;
- }
- public function getNoticeIds($offset, $limit, $since_id = null, $max_id = null)
- {
- $notice = new Notice();
-
- $notice->selectAdd();
- $notice->selectAdd('id');
-
- $notice->conversation = $this->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));
- }
- if (!is_null($offset)) {
- $notice->limit($offset, $limit);
- }
- self::filterVerbs($notice, $this->selectVerbs);
-
- $notice->orderBy('notice.created DESC, notice.id DESC');
- $notice->find();
- return $notice->fetchAll('id');
- }
- }
|