Fix Direct Message functionality.

This commit is contained in:
Mikael Nordfeldth
2014-04-29 20:37:58 +02:00
parent 7d191f8062
commit 34b570352f
5 changed files with 36 additions and 18 deletions

View File

@@ -586,7 +586,7 @@ class MessageCommand extends Command
function handle($channel)
{
try {
$other = $this->getUser($this->other);
$other = $this->getUser($this->other)->getProfile();
} catch (CommandException $e) {
try {
$profile = $this->getProfile($this->other);
@@ -619,7 +619,7 @@ class MessageCommand extends Command
return;
}
if (!$other) {
if (!$other instanceof Profile) {
// TRANS: Error text shown when trying to send a direct message to a user that does not exist.
$channel->error($this->user, _('No such user.'));
return;