Mercurial > xib
diff bot.py @ 152:17305e57f71d
removed automatic switching to limited mode (created Bridge.show_participants_list_on())
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sun, 17 Jan 2010 22:30:23 +0100 |
parents | a04840ad92b7 |
children | 63db565438bd |
line wrap: on
line diff
--- a/bot.py +++ b/bot.py @@ -649,32 +649,16 @@ class Bot(threading.Thread): return - # From here the event is shown - self.error(event_str, debug=True) + if event.eventtype() in ['disconnect', 'kill', 'error']: + if len(event.arguments()) > 0 and event.arguments()[0] == 'Connection reset by peer': + self.error(event_str, debug=True) + else: + self.error(event_str, send_to_admins=True) + return - if event.eventtype() in ['disconnect', 'kill']: - if len(event.arguments()) > 0 and event.arguments()[0] == 'Connection reset by peer': - return - - # TODO: lock self.bridges for thread safety - for bridge in self.bridges: - if connection.server != bridge.irc_server: - continue - try: - p = bridge.getParticipant(connection.get_nickname()) - if bridge.mode in ['normal', 'bypass']: - bridge.changeMode('limited') - else: - if p.irc_connection.really_connected == True: - p.irc_connection.part(bridge.irc_room, message=message) - p.irc_connection.used_by -= 1 - if p.irc_connection.used_by < 1: - p.irc_connection.close(message) - p.irc_connection = None - except Bridge.NoSuchParticipantException: - pass - return + # From here the event is shown + self.error(event_str, debug=True) # Nickname callbacks