diff bot.py @ 122:9e90e15913a7

bug fixes Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Wed, 13 Jan 2010 22:22:50 +0100
parents 765e460bc20a
children 99f3dee1fad7
line wrap: on
line diff
--- a/bot.py
+++ b/bot.py
@@ -781,7 +781,8 @@ class bot(Thread):
 					participants.append(p)
 					p.xmpp_c = None
 		self.error('===> Debug: reopening XMPP connection for "'+nickname+'"', debug=True)
-		self.xmpp_connections.pop(nickname)
+		if self.xmpp_connections.has_key(nickname):
+			self.xmpp_connections.pop(nickname)
 		c.send(xmpp.protocol.Presence(typ='unavailable'))
 		del c
 		c = self.get_xmpp_connection(nickname)
@@ -793,6 +794,7 @@ class bot(Thread):
 		c.mucs = mucs
 		for m in c.mucs:
 			m.rejoin()
+		return c
 	
 	
 	def close_xmpp_connection(self, nickname):