Mercurial > xib
comparison bridge.py @ 40:faa468731d8a
Tried to get thread safety and handle disconnections in muc.py
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sun, 23 Aug 2009 22:35:24 +0200 |
parents | 984e1e5c5e51 |
children | 41394ddb3aff |
comparison
equal
deleted
inserted
replaced
39:3b06450d60cd | 40:faa468731d8a |
---|---|
52 self.participants = [] | 52 self.participants = [] |
53 if mode not in self.__class__._modes: | 53 if mode not in self.__class__._modes: |
54 raise Exception('[Error] "'+mode+'" is not a correct value for a bridge\'s "mode" attribute') | 54 raise Exception('[Error] "'+mode+'" is not a correct value for a bridge\'s "mode" attribute') |
55 self.mode = mode | 55 self.mode = mode |
56 | 56 |
57 self.lock = threading.Lock() | 57 self.lock = threading.RLock() |
58 | 58 |
59 # Join XMPP room | 59 # Join XMPP room |
60 try: | 60 try: |
61 self.xmpp_room = xmpp.muc(xmpp_room_jid) | 61 self.xmpp_room = xmpp.muc(xmpp_room_jid) |
62 self.xmpp_room.join(self.bot.xmpp_c, self.bot.nickname, callback=self._xmpp_join_callback) | 62 self.xmpp_room.join(self.bot.xmpp_c, self.bot.nickname, callback=self._xmpp_join_callback) |