* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Notice stream for a conversation
*/
class ConversationNoticeStream extends ScopingNoticeStream
{
- function __construct($id, $profile = -1)
+ function __construct($id, Profile $scoped=null)
{
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
-
parent::__construct(new RawConversationNoticeStream($id),
- $profile);
+ $scoped);
}
}
function __construct($id)
{
+ parent::__construct();
$this->id = $id;
}
- function getNoticeIds($offset, $limit, $since_id, $max_id)
+ function getNoticeIds($offset, $limit, $since_id=null, $max_id=null)
{
- $conv = Conversation::getKV('id', $this->id);
- if (!$conv instanceof Conversation) {
- throw new ServerException('Could not find conversation');
- }
$notice = new Notice();
// SELECT
$notice->selectAdd();
if (!empty($max_id)) {
$notice->whereAdd(sprintf('notice.id <= %d', $max_id));
}
- $notice->limit($offset, $limit);
+ if (!is_null($offset)) {
+ $notice->limit($offset, $limit);
+ }
+
+ self::filterVerbs($notice, $this->selectVerbs);
// ORDER BY
// currently imitates the previously used "_reverseChron" sorting
$notice->orderBy('notice.created DESC');
+ $notice->find();
return $notice->fetchAll('id');
}
}