- $nickname = common_canonical_nickname($this->arg('nickname'));
-
- $this->user = User::getKV('nickname', $nickname);
-
- if (!$this->user instanceof User) {
- // TRANS: Client error displayed when trying to reply to a non-exsting user.
- $this->clientError(_('No such user.'));
- }
-
- $this->target = $this->user->getProfile();
-
- if (!$this->target instanceof Profile) {
- // TRANS: Error message displayed when referring to a user without a profile.
- $this->serverError(_('User has no profile.'));
- }
-
- $this->page = $this->int('page') ?: 1;
-
- common_set_returnto($this->selfUrl());
-
- $stream = new ReplyNoticeStream($this->target->getID(), $this->scoped);
-
- $this->notice = $stream->getNotices(($this->page-1) * NOTICES_PER_PAGE,
- NOTICES_PER_PAGE + 1);
-
- if ($this->page > 1 && $this->notice->N == 0) {
- // TRANS: Client error when page not found (404)
- $this->clientError(_('No such page.'), 404);
- }