From 4f47c2592c2c55142bdd74a3f8489a30b8edca4f Mon Sep 17 00:00:00 2001 From: Goffi Date: Mon, 27 Dec 2010 21:36:02 +0100 Subject: [PATCH] plugin xep 0045: workaround for MUCClient exceptions --- plugins/plugin_xep_0045.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/plugin_xep_0045.py b/plugins/plugin_xep_0045.py index ef672590..ed07075b 100755 --- a/plugins/plugin_xep_0045.py +++ b/plugins/plugin_xep_0045.py @@ -137,7 +137,12 @@ class XEP_0045(): warning(_('%(profile)s is already in room %(room_jid)s') % {'profile':profile, 'room_jid':room_jid}) return info (_("[%(profile)s] is joining room %(room)s with nick %(nick)s") % {'profile':profile,'room':roomId+'@'+service, 'nick':nick}) - self.clients[profile].join(service, roomId, nick).addCallbacks(self.__room_joined, self.__err_joining_room, callbackKeywords={'profile':profile}, errbackKeywords={'profile':profile}) + try: + self.clients[profile].join(service, roomId, nick).addCallbacks(self.__room_joined, self.__err_joining_room, callbackKeywords={'profile':profile}, errbackKeywords={'profile':profile}) + except: + #XXX: this is a ugly workaround as MUCClient thrown an error if there is invalid chars in the room jid (like with the default string) + #FIXME: must be removed when MUCClient manage this better + self.__err_joining_room(None, profile) def getHandler(self, profile): #reactor.callLater(15,self.join,"conference.necton2.int", "test", "Goffi \o/", profile)