* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-class ShowstreamAction extends ProfileAction
+class ShowstreamAction extends NoticestreamAction
{
- var $notice;
-
- protected function doPreparation()
- {
- // showstream requires a nickname
- $nickname_arg = $this->arg('nickname');
- $nickname = common_canonical_nickname($nickname_arg);
-
- // Permanent redirect on non-canonical nickname
-
- if ($nickname_arg != $nickname) {
- $args = array('nickname' => $nickname);
- if ($this->arg('page') && $this->arg('page') != 1) {
- $args['page'] = $this->arg['page'];
- }
- common_redirect(common_local_url($this->getActionName(), $args), 301);
- }
- $this->user = User::getKV('nickname', $nickname);
-
- if (!$this->user) {
- $group = Local_group::getKV('nickname', $nickname);
- if ($group instanceof Local_group) {
- common_redirect($group->getProfile()->getUrl());
- }
- // TRANS: Client error displayed when calling a profile action without specifying a user.
- $this->clientError(_('No such user.'), 404);
- }
-
- $this->target = $this->user->getProfile();
- }
-
- protected function profileActionPreparation()
- {
- $stream = $this->getStream();
- $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);
- }
- }
-
- protected function getStream()
+ public function getStream()
{
if (empty($this->tag)) {
$stream = new ProfileNoticeStream($this->target, $this->scoped);
return $stream;
}
-
function title()
{
$base = $this->target->getFancyName();
}
} else {
if ($this->page == 1) {
- return $base;
+ return sprintf(_('Notices by %s'), $base);
} else {
// TRANS: Extended page title showing tagged notices in one user's timeline.
// TRANS: %1$s is the username, %2$d is the page number.
}
}
- function showContent()
+ protected function showContent()
{
$this->showNotices();
}
'content' => $this->target->getDescription()));
}
- if ($this->target->isLocal() && $this->target->getUser()->emailmicroid && $this->target->getUser()->email && $this->target->getUrl()) {
- $id = new Microid('mailto:'.$this->target->getUser()->email,
- $this->selfUrl());
- $this->element('meta', array('name' => 'microid',
- 'content' => $id->toString()));
- }
-
// See https://wiki.mozilla.org/Microsummaries
$this->element('link', array('rel' => 'microsummary',
{
parent::showSections();
if (!common_config('performance', 'high')) {
- $cloud = new PersonalTagCloudSection($this, $this->user);
+ $cloud = new PersonalTagCloudSection($this->target, $this);
$cloud->show();
}
}
{
$options = parent::noticeFormOptions();
- if (!$this->scoped instanceof Profile || $this->scoped->id != $this->target->id) {
+ if (!$this->scoped instanceof Profile || !$this->scoped->sameAs($this->target)) {
$options['to_profile'] = $this->target;
}