From 2d311b93df92f39fee4622675a21a6582a2de7ec Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Sun, 2 Mar 2014 23:52:39 -0500 Subject: [PATCH] jabber_mirror: Ignore attempts to join invalid MUCs (imported from commit a82d53af1f581d059b6457a1bf7afe92af5d42d9) --- bots/jabber_mirror.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bots/jabber_mirror.py b/bots/jabber_mirror.py index 9588a79..ecf1582 100755 --- a/bots/jabber_mirror.py +++ b/bots/jabber_mirror.py @@ -42,7 +42,7 @@ import logging import threading import optparse -from sleekxmpp import ClientXMPP +from sleekxmpp import ClientXMPP, InvalidJID from sleekxmpp.exceptions import IqError, IqTimeout import os, sys, zulip, getpass import re @@ -96,7 +96,11 @@ class JabberToZulipBot(ClientXMPP): self.rooms.add(room) muc_jid = room + "@" + options.conference_domain xep0045 = self.plugin['xep_0045'] - xep0045.joinMUC(muc_jid, self.nick, wait=True) + try: + xep0045.joinMUC(muc_jid, self.nick, wait=True) + except InvalidJID: + logging.error("Could not join room: " + muc_jid) + return # Configure the room. Really, we should only do this if the room is # newly created.