Mercurial > xib
comparison irclib.py @ 234:c9c0d9a5e0b8
(irclib) tried to fix nick callbacks
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Mon, 08 Mar 2010 00:13:24 +0100 |
parents | 5f1e9211af03 |
children | 8acbfda313b9 |
comparison
equal
deleted
inserted
replaced
233:4ad8e985c7d3 | 234:c9c0d9a5e0b8 |
---|---|
724 | 724 |
725 # Translate numerics into more readable strings. | 725 # Translate numerics into more readable strings. |
726 if command in numeric_events: | 726 if command in numeric_events: |
727 command = numeric_events[command] | 727 command = numeric_events[command] |
728 | 728 |
729 if command in ["nick", "welcome"]: | |
730 self.logged_in = True | |
731 self.real_nickname = arguments[0] | |
732 if self.new_nickname != arguments[0]: | |
733 if len(self.new_nickname) > len(arguments[0]): | |
734 self._handle_event(Event('nicknametoolong', None, None, None)) | |
735 else: | |
736 self._handle_event(Event('erroneusnickname', None, None, None)) | |
737 else: | |
738 self._call_nick_callbacks(None) | |
739 self.new_nickname = None | |
740 | |
741 if command in ["privmsg", "notice"]: | 729 if command in ["privmsg", "notice"]: |
742 target, message = arguments[0], arguments[1] | 730 target, message = arguments[0], arguments[1] |
743 messages = _ctcp_dequote(message) | 731 messages = _ctcp_dequote(message) |
744 | 732 |
745 if command == "privmsg": | 733 if command == "privmsg": |
787 arguments = arguments[1:] | 775 arguments = arguments[1:] |
788 | 776 |
789 if command == "mode": | 777 if command == "mode": |
790 if not is_channel(target): | 778 if not is_channel(target): |
791 command = "umode" | 779 command = "umode" |
780 | |
781 if command in ["nick", "welcome"]: | |
782 self.logged_in = True | |
783 self.real_nickname = target | |
784 if self.new_nickname: | |
785 if self.new_nickname != target: | |
786 if len(self.new_nickname) > len(target): | |
787 self._handle_event(Event('nicknametoolong', None, None, None)) | |
788 else: | |
789 self._handle_event(Event('erroneusnickname', None, None, None)) | |
790 else: | |
791 self._call_nick_callbacks(None) | |
792 self.new_nickname = None | |
792 | 793 |
793 if command == "join": | 794 if command == "join": |
794 if self.irc_id != prefix: | 795 if self.irc_id != prefix: |
795 self.irc_id = prefix | 796 self.irc_id = prefix |
796 if DEBUG: | 797 if DEBUG: |