changeset 68:7aa1f59800b0

Fixed IRC nick callback Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sun, 30 Aug 2009 20:09:06 +0200
parents 2e3561313b0f
children 0a2b9e84bbde
files irclib.py participant.py
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/irclib.py
+++ b/irclib.py
@@ -437,7 +437,10 @@ class ServerConnection(Connection):
         if self.connected == True:
             self.used_by += 1
             self.irclibobj.bot.error('===> Debug: using existing IRC connection for '+self.__str__()+', this connection is now used by '+str(self.used_by)+' bridges', debug=True)
-            self.nick(self.real_nickname, callback=nick_callback)
+            if nick_callback != None:
+                self.add_nick_callback(nick_callback)
+            if self.really_connected == True:
+                self._call_nick_callbacks(None)
             self.lock.release()
             return self
 
--- a/participant.py
+++ b/participant.py
@@ -69,8 +69,6 @@ class participant:
 		sleep(1) # try to prevent "reconnecting too fast" shit
 		self.irc_connection = self.bridge.bot.irc.server(self.bridge.irc_server, self.bridge.irc_port, self.nickname)
 		self.irc_connection.connect(nick_callback=self._irc_nick_callback)
-		if self.irc_connection != None:
-			self.irc_connection.join(self.bridge.irc_room)
 	
 	
 	def _irc_nick_callback(self, error, arguments=[]):