From 2860313f4bb13344cfd53e197c9dbdb976a0b21e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 30 Aug 2008 05:01:48 -0400 Subject: [PATCH] eliminate loops in forwarding darcs-hash:20080830090148-84dde-2f5711a22c7e5a868005bb3188a966c0cdde30ab.gz --- scripts/xmppqueuehandler.php | 4 ++++ 1 file changed, 4 insertions(+) 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'])); }