function prepare($args)
{
parent::prepare($args);
- $cur = common_current_user();
- if (!empty($cur) && $cur->id == $this->user->id) {
- $this->notice = $this->user->noticeInboxThreaded(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
- } else {
- $this->notice = $this->user->noticesWithFriendsThreaded(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
- }
+ $stream = new ThreadingInboxNoticeStream($this->user, Profile::current());
+
+ $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
+ NOTICES_PER_PAGE + 1,
+ null,
+ null);
if ($this->page > 1 && $this->notice->N == 0) {
// TRANS: Server error when page not found (404).
- $this->serverError(_('No such page.'), $code = 404);
+ $this->serverError(_('No such page.'), 404);
}
return true;
);
}
- function showLocalNav()
- {
- $nav = new PersonalGroupNav($this);
- $nav->show();
- }
-
function showEmptyListMessage()
{
// TRANS: Empty list message. %s is a user nickname.
function showContent()
{
if (Event::handle('StartShowAllContent', array($this))) {
- $nl = new ThreadedNoticeList($this->notice, $this);
+
+ $profile = null;
+
+ $current_user = common_current_user();
+
+ if (!empty($current_user)) {
+ $profile = $current_user->getProfile();
+ }
+
+ $nl = new ThreadedNoticeList($this->notice, $this, $profile);
$cnt = $nl->show();
}
}
+ function showSections()
+ {
+ $ibs = new InviteButtonSection($this);
+ $ibs->show();
+ $this->showSubscriptions();
+ $this->showSubscribers();
+ $this->showGroups();
+ $this->showLists();
+ }
+
function showPageTitle()
{
$user = common_current_user();
}
}
}
+
+class ThreadingInboxNoticeStream extends ThreadingNoticeStream
+{
+ function __construct($user, $profile)
+ {
+ parent::__construct(new InboxNoticeStream($user, $profile));
+ }
+}