]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - xmppdaemon.php
don't do an end tag for empty elements
[quix0rs-gnu-social.git] / xmppdaemon.php
index 6509ed1faf4d51f57510baf853aed472d3f6d469..7086044716ae72bfd4a889ee464549e7c0257ba6 100755 (executable)
@@ -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);