function error($user, $text) {
return false;
}
+
+ function source() {
+ return NULL;
+ }
}
class XMPPChannel extends Channel {
var $conn = NULL;
+ function source() {
+ return 'xmpp';
+ }
+
function __construct($conn) {
$this->conn = $conn;
}
class WebChannel extends Channel {
+ function source() {
+ return 'web';
+ }
+
function on($user) {
return false;
}
class MailChannel extends Channel {
var $addr = NULL;
+
+ function source() {
+ return 'mail';
+ }
function __construct($addr=NULL) {
$this->addr = $addr;
$channel->error($this->user, _('Don\'t send a message to yourself; just say it to yourself quietly instead.'));
return;
}
- $message = Message::saveNew($this->user->id, $other->id, $body, 'xmpp');
+ $message = Message::saveNew($this->user->id, $other->id, $this->text, $channel->source());
if ($message) {
$channel->output($this->user, sprintf(_('Direct message to %s sent'), $this->other));
} else {