comparison irclib.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 c9c0d9a5e0b8
children e64b574afa8f
comparison
equal deleted inserted replaced
235:533a5db79389 236:8acbfda313b9
296 if len(e.args) > 0: 296 if len(e.args) > 0:
297 c = e.args[0] 297 c = e.args[0]
298 else: 298 else:
299 self.bot.error(say_levels.error, 'Unkonwn exception on IRC thread:\n'+str(e.args)) 299 self.bot.error(say_levels.error, 'Unkonwn exception on IRC thread:\n'+str(e.args))
300 continue 300 continue
301 if c.real_nickname == self.bot.nickname: 301 if c.nickname == self.bot.nickname:
302 self.bot.restart(message='Lost bot IRC connection') 302 self.bot.restart(message='Lost bot IRC connection')
303 else: 303 else:
304 c.disconnect(volontary=True) 304 c.disconnect(volontary=True)
305 c.connect() 305 c.connect()
306 except: 306 except:
778 if not is_channel(target): 778 if not is_channel(target):
779 command = "umode" 779 command = "umode"
780 780
781 if command in ["nick", "welcome"]: 781 if command in ["nick", "welcome"]:
782 self.logged_in = True 782 self.logged_in = True
783 self.real_nickname = target 783 if self.new_nickname and isinstance(target, basestring):
784 if self.new_nickname: 784 self.real_nickname = target
785 if self.new_nickname != target: 785 if self.new_nickname != target:
786 if len(self.new_nickname) > len(target): 786 if len(self.new_nickname) > len(target):
787 self._handle_event(Event('nicknametoolong', None, None, None)) 787 self._handle_event(Event('nicknametoolong', None, None, None))
788 else: 788 else:
789 self._handle_event(Event('erroneusnickname', None, None, None)) 789 self._handle_event(Event('erroneusnickname', None, None, None))