From 1cf81a57e475c89b9431576c6a5abc7bbe3b3aa0 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 30 Aug 2008 04:56:07 -0400 Subject: [PATCH] check for self in forwards, too darcs-hash:20080830085607-84dde-83e95d40d4d8a64a6bc223a0e91fec53022422c6.gz --- scripts/xmppdaemon.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index 574aeab36a..1cfcd481f5 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');