return;
}
- mail_notify_message($message, $this->user, $this->other);
+ $message->notify();
if ($this->format == 'xml') {
$this->showSingleXmlDirectMessage($message);
return;
}
- $this->notify($user, $this->other, $message);
+ $message->notify();
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
}
}
- function notify($from, $to, $message)
- {
- mail_notify_message($message, $from, $to);
- // XXX: Jabber, SMS notifications... probably queued
- }
-
// Do nothing (override)
function showNoticeForm()
$contentlimit = self::maxContent();
return ($contentlimit > 0 && !empty($content) && (mb_strlen($content) > $contentlimit));
}
+
+ function notify()
+ {
+ $from = User::staticGet('id', $this->from_profile);
+ $to = User::staticGet('id', $this->to_profile);
+
+ mail_notify_message($this, $from, $to);
+ }
}
}
$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.'));