summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-07-07 20:30:55 -0400
committerEvan Prodromou <evan@prodromou.name>2008-07-07 20:30:55 -0400
commit6942064d12c838cc26875a43c1d5997f94ec5988 (patch)
treeb21291d3bb70280651364fd1b9829062bc7efc1e
parentada9835470ecd90f63264041abdf9c4f838ff60e (diff)
autoreply
darcs-hash:20080708003055-84dde-8ab47a05b658d2de9bf8e55f70f8a9fb9a77b23a.gz
-rwxr-xr-xxmppdaemon.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/xmppdaemon.php b/xmppdaemon.php
index 6509ed1fa..708604471 100755
--- a/xmppdaemon.php
+++ b/xmppdaemon.php
@@ -135,11 +135,22 @@ class XMPPDaemon {
}
if ($this->handle_command($user, $pl['body'])) {
return;
+ } else if ($this->is_autoreply($pl['body'])) {
+ $this->log(LOG_INFO, 'Ignoring auto reply from ' . $from);
+ return;
} else {
$this->add_notice($user, $pl);
}
}
+ function is_autoreply($txt) {
+ if (preg_match('/[\[\(]?[Aa]uto-?[Rr]eply[\]\)]/', $txt)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
function from_site($address, $msg) {
$text = '['.common_config('site', 'name') . '] ' . $msg;
jabber_send_message($address, $text);