diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-08-30 04:56:07 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-08-30 04:56:07 -0400 |
commit | 1cf81a57e475c89b9431576c6a5abc7bbe3b3aa0 (patch) | |
tree | d3b1555dbbaf1bde51afb6b75be6f9cb0013e9a4 /scripts | |
parent | 6c42bdc4480be3e5248550225f531a52c28cb050 (diff) |
check for self in forwards, too
darcs-hash:20080830085607-84dde-83e95d40d4d8a64a6bc223a0e91fec53022422c6.gz
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/xmppdaemon.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index 574aeab36..1cfcd481f 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -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'); |