]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
eliminate loops in forwarding
authorEvan Prodromou <evan@prodromou.name>
Sat, 30 Aug 2008 09:01:48 +0000 (05:01 -0400)
committerEvan Prodromou <evan@prodromou.name>
Sat, 30 Aug 2008 09:01:48 +0000 (05:01 -0400)
darcs-hash:20080830090148-84dde-2f5711a22c7e5a868005bb3188a966c0cdde30ab.gz

scripts/xmppqueuehandler.php

index 2adcdf7e477e25ea4dfcec6717ed018b020fb8e2..040191c283cbbd93626b1082e0e0e28aeb9263fc 100755 (executable)
@@ -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']));
        }