# HG changeset patch # User Goffi # Date 1293482162 -3600 # Node ID c5274bf5e18b9037d4f8652984c38017b42098c4 # Parent 782319a64ac6bb059cafd615f24579070143b407 plugin xep 0045: workaround for MUCClient exceptions diff -r 782319a64ac6 -r c5274bf5e18b plugins/plugin_xep_0045.py --- a/plugins/plugin_xep_0045.py Mon Dec 27 21:14:09 2010 +0100 +++ b/plugins/plugin_xep_0045.py Mon Dec 27 21:36:02 2010 +0100 @@ -137,7 +137,12 @@ 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)