Mercurial > xib
comparison bot.py @ 236:8acbfda313b9
use ServerConnection.nickname instead of .real_nickname in most cases, make sure we put a string in .real_nickname
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Mon, 08 Mar 2010 10:32:50 +0100 |
parents | 533a5db79389 |
children | a6c37733357a |
comparison
equal
deleted
inserted
replaced
235:533a5db79389 | 236:8acbfda313b9 |
---|---|
557 self.error(2, debug_str, debug=True) | 557 self.error(2, debug_str, debug=True) |
558 | 558 |
559 bridge = self.get_bridge(irc_room=event.arguments()[0], irc_server=connection.server) | 559 bridge = self.get_bridge(irc_room=event.arguments()[0], irc_server=connection.server) |
560 | 560 |
561 if event.eventtype() == 'cannotsendtochan': | 561 if event.eventtype() == 'cannotsendtochan': |
562 if connection.real_nickname == self.nickname: | 562 if connection.nickname == self.nickname: |
563 bridge._join_irc_failed(event.eventtype()) | 563 bridge._join_irc_failed(event.eventtype()) |
564 else: | 564 else: |
565 p = bridge.get_participant(connection.real_nickname) | 565 p = bridge.get_participant(connection.nickname) |
566 p._close_irc_connection(event.eventtype()) | 566 p._close_irc_connection(event.eventtype()) |
567 p.irc_connection = event.eventtype() | 567 p.irc_connection = event.eventtype() |
568 | 568 |
569 elif event.eventtype() == 'notonchannel': | 569 elif event.eventtype() == 'notonchannel': |
570 if connection.real_nickname == self.nickname: | 570 if connection.nickname == self.nickname: |
571 bridge.restart(message='Restarting bridge because we received the IRC event '+event.eventtype()) | 571 bridge.restart(message='Restarting bridge because we received the IRC event '+event.eventtype()) |
572 else: | 572 else: |
573 p = bridge.get_participant(connection.real_nickname) | 573 p = bridge.get_participant(connection.nickname) |
574 p.irc_connection.join(bridge.irc_room) | 574 p.irc_connection.join(bridge.irc_room) |
575 | 575 |
576 return | 576 return |
577 | 577 |
578 | 578 |
579 # Ignore events not received on bot connection | 579 # Ignore events not received on bot connection |
580 if connection.real_nickname != self.nickname: | 580 if connection.nickname != self.nickname: |
581 self.error(1, 'ignoring IRC '+event.eventtype()+' not received on bridge connection', debug=True) | 581 self.error(1, 'ignoring IRC '+event.eventtype()+' not received on bridge connection', debug=True) |
582 return | 582 return |
583 | 583 |
584 | 584 |
585 # Chan events | 585 # Chan events |