summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-08-05 20:21:34 -0400
committerEvan Prodromou <evan@prodromou.name>2008-08-05 20:21:34 -0400
commit120970434e01be250f643df79bda21169060fb6e (patch)
tree3dda2fdaa28ce77e295f0f6452a91b8ddc322749
parent6d5a61de9f9c7a6e577b9e81907768b8be57b930 (diff)
ignore OTR messages over Jabber (I think)
darcs-hash:20080806002134-84dde-1674375f840a61ce469be784805a969beff35f43.gz
-rwxr-xr-xxmppdaemon.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/xmppdaemon.php b/xmppdaemon.php
index 7977dc804..37b349f58 100755
--- a/xmppdaemon.php
+++ b/xmppdaemon.php
@@ -172,6 +172,9 @@ class XMPPDaemon {
} else if ($this->is_autoreply($pl['body'])) {
$this->log(LOG_INFO, 'Ignoring auto reply from ' . $from);
return;
+ } else if ($this->is_otr($pl['body'])) {
+ $this->log(LOG_INFO, 'Ignoring OTR from ' . $from);
+ return;
} else {
$this->add_notice($user, $pl);
}
@@ -185,6 +188,14 @@ class XMPPDaemon {
}
}
+ function is_otr($txt) {
+ if (preg_match('/^\?OTR/', $txt)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
function from_site($address, $msg) {
$text = '['.common_config('site', 'name') . '] ' . $msg;
jabber_send_message($address, $text);