remove dead code for handling direct messages, now done with commands

This commit is contained in:
Evan Prodromou 2009-12-15 10:12:36 -05:00
parent e99e66eff0
commit d40f0931aa

View File

@ -195,17 +195,6 @@ class XMPPDaemon extends Daemon
} else if ($this->is_otr($pl['body'])) { } else if ($this->is_otr($pl['body'])) {
$this->log(LOG_INFO, 'Ignoring OTR from ' . $from); $this->log(LOG_INFO, 'Ignoring OTR from ' . $from);
return; return;
} else if ($this->is_direct($pl['body'])) {
$this->log(LOG_INFO, 'Got a direct message ' . $from);
preg_match_all('/d[\ ]*([a-z0-9]{1,64})/', $pl['body'], $to);
$to = preg_replace('/^d([\ ])*/', '', $to[0][0]);
$body = preg_replace('/d[\ ]*('. $to .')[\ ]*/', '', $pl['body']);
$this->log(LOG_INFO, 'Direct message from '. $user->nickname . ' to ' . $to);
$this->add_direct($user, $body, $to, $from);
} else { } else {
$this->log(LOG_INFO, 'Posting a notice from ' . $user->nickname); $this->log(LOG_INFO, 'Posting a notice from ' . $user->nickname);
@ -284,15 +273,6 @@ class XMPPDaemon extends Daemon
} }
} }
function is_direct($txt)
{
if (strtolower(substr($txt, 0, 2))=='d ') {
return true;
} else {
return false;
}
}
function from_site($address, $msg) function from_site($address, $msg)
{ {
$text = '['.common_config('site', 'name') . '] ' . $msg; $text = '['.common_config('site', 'name') . '] ' . $msg;