diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-08-30 05:01:48 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-08-30 05:01:48 -0400 |
commit | 2860313f4bb13344cfd53e197c9dbdb976a0b21e (patch) | |
tree | 060a043ecb03f7719c21066dba7d1617ffe56aee /scripts/xmppqueuehandler.php | |
parent | 1cf81a57e475c89b9431576c6a5abc7bbe3b3aa0 (diff) |
eliminate loops in forwarding
darcs-hash:20080830090148-84dde-2f5711a22c7e5a868005bb3188a966c0cdde30ab.gz
Diffstat (limited to 'scripts/xmppqueuehandler.php')
-rwxr-xr-x | scripts/xmppqueuehandler.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/xmppqueuehandler.php b/scripts/xmppqueuehandler.php index 2adcdf7e4..040191c28 100755 --- a/scripts/xmppqueuehandler.php +++ b/scripts/xmppqueuehandler.php @@ -67,6 +67,10 @@ class XmppQueueHandler extends QueueHandler { return; } $listener = $this->listener(); + if (strtolower($listener) == strtolower($pl['from'])) { + $this->log(LOG_WARNING, 'Ignoring loop message.'); + return; + } $this->log(LOG_INFO, 'Forwarding message from ' . $pl['from'] . ' to ' . $listener); $this->conn->message($this->listener(), $pl['body'], 'chat', NULL, $this->ofrom($pl['from'])); } |