From 32ec19cb12c68b4ff9dab59972d7600982399195 Mon Sep 17 00:00:00 2001
From: Zev Benjamin <zev@zulip.com>
Date: Sun, 2 Mar 2014 23:00:26 -0500
Subject: [PATCH] jabber_mirror: Don't try to mirror messages from rooms
 themselves

These are usually administrative messages.

(imported from commit 58cbbc739fdd47acc586c235aedd2fccc83654fd)
---
 bots/jabber_mirror.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bots/jabber_mirror.py b/bots/jabber_mirror.py
index 34500d6a..550354d4 100755
--- a/bots/jabber_mirror.py
+++ b/bots/jabber_mirror.py
@@ -142,6 +142,10 @@ class JabberToZulipBot(ClientXMPP):
             subject = "(no topic)"
         stream = room_to_stream(msg.get_mucroom())
         jid = self.nickname_to_jid(msg.get_mucroom(), msg.get_mucnick())
+        if str(jid) == "@" + options.jabber_domain:
+            # Messages from the room itself have no nickname.  We should not try
+            # to mirror these
+            return
         sender = jid_to_zulip(jid)
         zulip_message = dict(
             forged = "yes",