From: Evan Prodromou Date: Sat, 30 Aug 2008 09:01:48 +0000 (-0400) Subject: eliminate loops in forwarding X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2860313f4bb13344cfd53e197c9dbdb976a0b21e;p=quix0rs-gnu-social.git eliminate loops in forwarding darcs-hash:20080830090148-84dde-2f5711a22c7e5a868005bb3188a966c0cdde30ab.gz --- diff --git a/scripts/xmppqueuehandler.php b/scripts/xmppqueuehandler.php index 2adcdf7e47..040191c283 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'])); }