- parent::prepare($args);
-
- $nickname = common_canonical_nickname($this->arg('nickname'));
-
- $this->user = User::staticGet('nickname', $nickname);
-
- if (!$this->user) {
- // TRANS: Client error displayed when trying to reply to a non-exsting user.
- $this->clientError(_('No such user.'));
- return false;
- }
-
- $profile = $this->user->getProfile();
-
- if (!$profile) {
- // TRANS: Error message displayed when referring to a user without a profile.
- $this->serverError(_('User has no profile.'));
- return false;
- }
-
- $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
-
- common_set_returnto($this->selfUrl());
-
- $stream = new ReplyNoticeStream($this->user->id,
- Profile::current());
-
- $this->notice = $stream->getNotices(($this->page-1) * NOTICES_PER_PAGE,
- NOTICES_PER_PAGE + 1);
-
- if($this->page > 1 && $this->notice->N == 0){
- // TRANS: Server error when page not found (404)
- $this->serverError(_('No such page.'),$code=404);
- }
-
- return true;
- }
-
- /**
- * Handle a request
- *
- * Just show the page. All args already handled.
- *
- * @param array $args $_REQUEST data
- *
- * @return void
- */
- function handle($args)
- {
- parent::handle($args);
- $this->showPage();