diff bot.py @ 91:69e4fc0f015c

Tried to fix XMPP «Replaced by new connection» problem Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sun, 20 Sep 2009 16:10:52 +0200
parents 965dd6f5fcc3
children aae8870b3727
line wrap: on
line diff
--- a/bot.py
+++ b/bot.py
@@ -104,6 +104,11 @@ class bot(Thread):
 			except (xml.parsers.expat.ExpatError, xmpp.protocol.XMLNotWellFormed):
 				self.error('=> Debug: invalid stanza', debug=True)
 				unlock = True
+			except xmpp.Conflict:
+				c.reconnectAndReauth()
+				for m in c.mucs:
+					m.rejoin()
+				unlock = True
 			except:
 				error = '[Error] Unkonwn exception on XMPP thread:\n'
 				error += traceback.format_exc()