From 2d8910dc7edc069db5c83cd49f79449192b4f289 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Sun, 2 Mar 2014 23:47:25 -0500 Subject: [PATCH] jabber_mirror: Configure rooms after joining (imported from commit d4c6e895dca1c7002ce39db81b671ba1c975d517) --- bots/jabber_mirror.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bots/jabber_mirror.py b/bots/jabber_mirror.py index 550354d..9588a79 100755 --- a/bots/jabber_mirror.py +++ b/bots/jabber_mirror.py @@ -95,7 +95,20 @@ class JabberToZulipBot(ClientXMPP): logging.debug("Joining " + room) self.rooms.add(room) muc_jid = room + "@" + options.conference_domain - self.plugin['xep_0045'].joinMUC(muc_jid, self.nick) + xep0045 = self.plugin['xep_0045'] + xep0045.joinMUC(muc_jid, self.nick, wait=True) + + # Configure the room. Really, we should only do this if the room is + # newly created. + form = None + try: + form = xep0045.getRoomConfig(muc_jid) + except ValueError: + pass + if form: + xep0045.configureRoom(muc_jid, form) + else: + logging.error("Could not configure room: " + muc_jid) def leave_muc(self, room): if room not in self.rooms: