diff 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
line wrap: on
line diff
--- a/bot.py
+++ b/bot.py
@@ -559,25 +559,25 @@ class Bot(threading.Thread):
 			bridge = self.get_bridge(irc_room=event.arguments()[0], irc_server=connection.server)
 			
 			if event.eventtype() == 'cannotsendtochan':
-				if connection.real_nickname == self.nickname:
+				if connection.nickname == self.nickname:
 					bridge._join_irc_failed(event.eventtype())
 				else:
-					p = bridge.get_participant(connection.real_nickname)
+					p = bridge.get_participant(connection.nickname)
 					p._close_irc_connection(event.eventtype())
 					p.irc_connection = event.eventtype()
 			
 			elif event.eventtype() == 'notonchannel':
-				if connection.real_nickname == self.nickname:
+				if connection.nickname == self.nickname:
 					bridge.restart(message='Restarting bridge because we received the IRC event '+event.eventtype())
 				else:
-					p = bridge.get_participant(connection.real_nickname)
+					p = bridge.get_participant(connection.nickname)
 					p.irc_connection.join(bridge.irc_room)
 			
 			return
 		
 		
 		# Ignore events not received on bot connection
-		if connection.real_nickname != self.nickname:
+		if connection.nickname != self.nickname:
 			self.error(1, 'ignoring IRC '+event.eventtype()+' not received on bridge connection', debug=True)
 			return