comparison participant.py @ 150:e0eea72ea493

new bridge attribute "irc_connection_interval" (in seconds) Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sun, 17 Jan 2010 21:14:23 +0100
parents ddc87b605019
children 64a0e9636ae6
comparison
equal deleted inserted replaced
149:332bb2e8e71e 150:e0eea72ea493
106 106
107 107
108 def createDuplicateOnIRC(self): 108 def createDuplicateOnIRC(self):
109 if isinstance(self.xmpp_c, xmpp.client.Client) or isinstance(self.irc_connection, ServerConnection): 109 if isinstance(self.xmpp_c, xmpp.client.Client) or isinstance(self.irc_connection, ServerConnection):
110 return 110 return
111 sleep(1) # try to prevent "reconnecting too fast" shit 111 sleep(self.bridge.irc_connection_interval) # to prevent "reconnecting too fast"
112 self.irc_connection = self.bridge.bot.irc.open_connection(self.bridge.irc_server, self.bridge.irc_port, self.duplicate_nickname) 112 self.irc_connection = self.bridge.bot.irc.open_connection(self.bridge.irc_server, self.bridge.irc_port, self.duplicate_nickname)
113 self.irc_connection.connect(nick_callback=self._irc_nick_callback) 113 self.irc_connection.connect(nick_callback=self._irc_nick_callback)
114 114
115 115
116 def _irc_nick_callback(self, error, arguments=[]): 116 def _irc_nick_callback(self, error, arguments=[]):