comparison bridge.py @ 3:3f651f4fdb4f

Added IRC "part" event handling Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sun, 16 Aug 2009 17:10:12 +0200
parents 4c842d23d4ce
children cb0daec4b778
comparison
equal deleted inserted replaced
2:f2d0a8b448db 3:3f651f4fdb4f
101 """Remove the participant using nickname from the bridge. Raises a NoSuchParticipantException if nickname is not used in the bridge.""" 101 """Remove the participant using nickname from the bridge. Raises a NoSuchParticipantException if nickname is not used in the bridge."""
102 p = self.getParticipant(nickname) 102 p = self.getParticipant(nickname)
103 if p.protocol == 'both': 103 if p.protocol == 'both':
104 self.bot.error('===> Debug: "'+nickname+'" was on both sides of bridge "'+str(self)+'" but left '+protocol, debug=True) 104 self.bot.error('===> Debug: "'+nickname+'" was on both sides of bridge "'+str(self)+'" but left '+protocol, debug=True)
105 if protocol == 'xmpp': 105 if protocol == 'xmpp':
106 p.protocol = 'irc'
107 p.createDuplicateOnXMPP()
108 elif protocol == 'irc':
109 p.protocol = 'xmpp'
106 p.createDuplicateOnIRC() 110 p.createDuplicateOnIRC()
107 elif protocol == 'irc':
108 p.createDuplicateOnXMPP()
109 else: 111 else:
110 raise Exception('Internal Error: bad protocol') 112 raise Exception('Internal Error: bad protocol')
111 else: 113 else:
112 self.bot.error('===> Debug: removing participant "'+nickname+'" from bridge "'+str(self)+'"', debug=True) 114 self.bot.error('===> Debug: removing participant "'+nickname+'" from bridge "'+str(self)+'"', debug=True)
113 self.participants.remove(p) 115 self.participants.remove(p)