create a method for notification for new messages, and use it

This commit is contained in:
Evan Prodromou
2009-12-15 10:31:25 -05:00
parent 19bb9a04d1
commit 797a0d79fb
4 changed files with 11 additions and 9 deletions

View File

@@ -372,7 +372,7 @@ class MessageCommand extends Command
}
$message = Message::saveNew($this->user->id, $other->id, $this->text, $channel->source());
if ($message) {
mail_notify_message($message, $this->user, $other);
$message->notify();
$channel->output($this->user, sprintf(_('Direct message to %s sent'), $this->other));
} else {
$channel->error($this->user, _('Error sending direct message.'));