Using a bit more of $this->scoped (Action parent class)

$this->scoped is the currently active profile, which is intended
to replace the $user object in the long run...
This commit is contained in:
Mikael Nordfeldth 2013-09-09 20:45:20 +02:00
parent b2a0aa20bf
commit c5bf6cb05e
2 changed files with 8 additions and 8 deletions

View File

@ -132,13 +132,13 @@ class NewmessageAction extends FormAction
// TRANS: Client error displayed trying to send a direct message to a user while sender and
// TRANS: receiver are not subscribed to each other.
$this->clientError(_('You cannot send a message to this user.'), 404);
} else if ($user->id == $this->other->id) {
} else if ($this->scoped->id == $this->other->id) {
// TRANS: Client error displayed trying to send a direct message to self.
$this->clientError(_('Do not send a message to yourself; ' .
'just say it to yourself quietly instead.'), 403);
}
$message = Message::saveNew($user->id, $this->other->id, $this->content, 'web');
$message = Message::saveNew($this->scoped->id, $this->other->id, $this->content, 'web');
$message->notify();
if ($this->boolean('ajax')) {
@ -157,7 +157,7 @@ class NewmessageAction extends FormAction
$this->elementEnd('html');
} else {
$url = common_local_url('outbox',
array('nickname' => $user->nickname));
array('nickname' => $this->scoped->nickname));
common_redirect($url, 303);
}
}

View File

@ -145,19 +145,19 @@ class NewnoticeAction extends FormAction
$this->trimmed('lon'),
$this->trimmed('location_id'),
$this->trimmed('location_ns'),
$user->getProfile());
$this->scoped);
} else {
$locOptions = Notice::locationOptions(null,
null,
null,
null,
$user->getProfile());
$this->scoped);
}
$options = array_merge($options, $locOptions);
}
$author_id = $user->id;
$author_id = $this->scoped->id;
$text = $content_shortened;
// Does the heavy-lifting for getting "To:" information
@ -166,7 +166,7 @@ class NewnoticeAction extends FormAction
if (Event::handle('StartNoticeSaveWeb', array($this, &$author_id, &$text, &$options))) {
$notice = Notice::saveNew($user->id, $content_shortened, 'web', $options);
$notice = Notice::saveNew($this->scoped->id, $content_shortened, 'web', $options);
if (isset($upload)) {
$upload->attachToNotice($notice);
@ -194,7 +194,7 @@ class NewnoticeAction extends FormAction
if ($returnto) {
$url = common_local_url($returnto,
array('nickname' => $user->nickname));
array('nickname' => $this->scoped->nickname));
} else {
$url = common_local_url('shownotice',
array('notice' => $notice->id));