123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?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->find();
- return $notice->fetchAll('id');
- }
- }
|