- if (empty($this->inbox)) {
- $this->inbox = Inbox::fromNoticeInbox($user_id);
- if (empty($this->inbox)) {
- return array();
- } else {
- $this->inbox->encache();
- }
- }
-
- $ids = $this->inbox->unpack();
-
- if (!empty($since_id)) {
- $newids = array();
- foreach ($ids as $id) {
- if ($id > $since_id) {
- $newids[] = $id;
- }
- }
- $ids = $newids;
- }
-
- if (!empty($max_id)) {
- $newids = array();
- foreach ($ids as $id) {
- if ($id <= $max_id) {
- $newids[] = $id;
- }
- }
- $ids = $newids;
+ $notice = new Notice();
+ $notice->selectAdd();
+ $notice->selectAdd('notice_id');
+ // Reply is a class for mentions
+ $notice->joinAdd(array('id', 'reply:notice_id'));
+
+ $notice->profile_id = $this->target->id;
+ $notice->limit($offset, $limit);
+ $notice->orderBy('created DESC');
+
+ if (!$notice->find()) {
+ return array();