jabber_mirror: Ignore attempts to join invalid MUCs
(imported from commit a82d53af1f581d059b6457a1bf7afe92af5d42d9)
This commit is contained in:
parent
2d8910dc7e
commit
2d311b93df
|
@ -42,7 +42,7 @@ import logging
|
||||||
import threading
|
import threading
|
||||||
import optparse
|
import optparse
|
||||||
|
|
||||||
from sleekxmpp import ClientXMPP
|
from sleekxmpp import ClientXMPP, InvalidJID
|
||||||
from sleekxmpp.exceptions import IqError, IqTimeout
|
from sleekxmpp.exceptions import IqError, IqTimeout
|
||||||
import os, sys, zulip, getpass
|
import os, sys, zulip, getpass
|
||||||
import re
|
import re
|
||||||
|
@ -96,7 +96,11 @@ class JabberToZulipBot(ClientXMPP):
|
||||||
self.rooms.add(room)
|
self.rooms.add(room)
|
||||||
muc_jid = room + "@" + options.conference_domain
|
muc_jid = room + "@" + options.conference_domain
|
||||||
xep0045 = self.plugin['xep_0045']
|
xep0045 = self.plugin['xep_0045']
|
||||||
|
try:
|
||||||
xep0045.joinMUC(muc_jid, self.nick, wait=True)
|
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
|
# Configure the room. Really, we should only do this if the room is
|
||||||
# newly created.
|
# newly created.
|
||||||
|
|
Loading…
Reference in a new issue