plugin xep 0045: workaround for MUCClient exceptions

This commit is contained in:
Goffi 2010-12-27 21:36:02 +01:00
commit 4f47c2592c

View file

@ -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)