eliminate loops in forwarding

darcs-hash:20080830090148-84dde-2f5711a22c7e5a868005bb3188a966c0cdde30ab.gz
This commit is contained in:
Evan Prodromou 2008-08-30 05:01:48 -04:00
parent 1cf81a57e4
commit 2860313f4b
1 changed files with 4 additions and 0 deletions

View File

@ -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']));
}