]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
check for self in forwards, too
authorEvan Prodromou <evan@prodromou.name>
Sat, 30 Aug 2008 08:56:07 +0000 (04:56 -0400)
committerEvan Prodromou <evan@prodromou.name>
Sat, 30 Aug 2008 08:56:07 +0000 (04:56 -0400)
darcs-hash:20080830085607-84dde-83e95d40d4d8a64a6bc223a0e91fec53022422c6.gz

scripts/xmppdaemon.php

index 574aeab36a105a9bad74b2cc4997ab9107c42a1b..1cfcd481f54cec44acf3a1e4bc91aa6eff62bedf 100755 (executable)
@@ -95,9 +95,9 @@ class XMPPDaemon {
                # Forwarded from another daemon (probably a broadcaster) for
                # us to handle
 
-               if (preg_match('/^'.strtolower(jabber_daemon_address()).'/', strtolower($from))) {
+               if ($this->is_self($from)) {
                        $from = $this->get_ofrom($pl);
-                       if (is_null($from)) {
+                       if (is_null($from) || $this->is_self($from)) {
                                return;
                        }
                }
@@ -129,6 +129,10 @@ class XMPPDaemon {
                }
        }
 
+       function is_self($from) {
+               return preg_match('/^'.strtolower(jabber_daemon_address()).'/', strtolower($from));
+       }
+       
        function get_ofrom($pl) {
                $xml = $pl['raw'];
                $addresses = $xml->sub('addresses');