X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Finboxnoticestream.php;h=0eb791d70a45823a140629e235b20b75d4ccf26f;hb=4b2a66ed29091209c05d74755e42f96265c846ce;hp=913e9fff2e85e685feb95b1e9709810d523ee9ae;hpb=f0c718b1aff591120074b087b0bc219783b26df7;p=quix0rs-gnu-social.git diff --git a/lib/inboxnoticestream.php b/lib/inboxnoticestream.php index 913e9fff2e..0eb791d70a 100644 --- a/lib/inboxnoticestream.php +++ b/lib/inboxnoticestream.php @@ -102,19 +102,22 @@ class RawInboxNoticeStream extends NoticeStream { $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->selectAdd('id'); + $notice->whereAdd(sprintf('notice.created > "%s"', $notice->escape($this->target->created))); + // Reply:: is a table of mentions + // Subscription:: is a table of subscriptions (every user is subscribed to themselves) + $notice->whereAdd( + sprintf('notice.id IN (SELECT notice_id FROM reply WHERE profile_id=%1$d) ' . + 'OR notice.profile_id IN (SELECT subscribed FROM subscription WHERE subscriber=%d)', $this->target->id) + ); $notice->limit($offset, $limit); - $notice->orderBy('created DESC'); + $notice->orderBy('notice.created DESC'); if (!$notice->find()) { return array(); } - $ids = $notice->fetchAll('notice_id'); + $ids = $notice->fetchAll('id'); return $ids; }