comparison 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
comparison
equal deleted inserted replaced
121:765e460bc20a 122:9e90e15913a7
779 for p in b.participants: 779 for p in b.participants:
780 if p.xmpp_c == c: 780 if p.xmpp_c == c:
781 participants.append(p) 781 participants.append(p)
782 p.xmpp_c = None 782 p.xmpp_c = None
783 self.error('===> Debug: reopening XMPP connection for "'+nickname+'"', debug=True) 783 self.error('===> Debug: reopening XMPP connection for "'+nickname+'"', debug=True)
784 self.xmpp_connections.pop(nickname) 784 if self.xmpp_connections.has_key(nickname):
785 self.xmpp_connections.pop(nickname)
785 c.send(xmpp.protocol.Presence(typ='unavailable')) 786 c.send(xmpp.protocol.Presence(typ='unavailable'))
786 del c 787 del c
787 c = self.get_xmpp_connection(nickname) 788 c = self.get_xmpp_connection(nickname)
788 c.used_by = used_by 789 c.used_by = used_by
789 if bot_connection: 790 if bot_connection:
791 for p in participants: 792 for p in participants:
792 p.xmpp_c = c 793 p.xmpp_c = c
793 c.mucs = mucs 794 c.mucs = mucs
794 for m in c.mucs: 795 for m in c.mucs:
795 m.rejoin() 796 m.rejoin()
797 return c
796 798
797 799
798 def close_xmpp_connection(self, nickname): 800 def close_xmpp_connection(self, nickname):
799 if not self.xmpp_connections.has_key(nickname): 801 if not self.xmpp_connections.has_key(nickname):
800 return 802 return