Mercurial > xib
comparison bridge.py @ 63:71508f22edb4
Fixed unjustified switching to limited mode
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sat, 29 Aug 2009 21:57:49 +0200 |
parents | 61491895c607 |
children | 8fc496eaa17b |
comparison
equal
deleted
inserted
replaced
62:61491895c607 | 63:71508f22edb4 |
---|---|
264 i = 0 | 264 i = 0 |
265 for p in self.participants: | 265 for p in self.participants: |
266 if p.protocol == 'xmpp': | 266 if p.protocol == 'xmpp': |
267 i += 1 | 267 i += 1 |
268 if p.irc_connection != None: | 268 if p.irc_connection != None: |
269 p.irc_connection.close('Bridge is switching to limited mode') | 269 p.irc_connection.close('Bridge is switching to limited mode', volontary=True) |
270 p.irc_connection = None | 270 p.irc_connection = None |
271 self.irc_connections_limit = i | 271 self.irc_connections_limit = i |
272 self.bot.error('===> Bridge is switching to limited mode. Limit seems to be '+str(self.irc_connections_limit)+' on "'+self.irc_server+'".') | 272 self.bot.error('===> Bridge is switching to limited mode. Limit seems to be '+str(self.irc_connections_limit)+' on "'+self.irc_server+'".') |
273 self.say('[Warning] Bridge is switching to limited mode, it means that it will be transparent for XMPP users but not for IRC users, this is due to the IRC servers\' per-IP-address connections\' limit number which seems to be '+str(self.irc_connections_limit)+' on "'+self.irc_server+'".') | 273 self.say('[Warning] Bridge is switching to limited mode, it means that it will be transparent for XMPP users but not for IRC users, this is due to the IRC servers\' per-IP-address connections\' limit number which seems to be '+str(self.irc_connections_limit)+' on "'+self.irc_server+'".') |
274 xmpp_participants_nicknames = self.get_participants_nicknames_list(protocols=['xmpp']) | 274 xmpp_participants_nicknames = self.get_participants_nicknames_list(protocols=['xmpp']) |
287 del self.participants | 287 del self.participants |
288 | 288 |
289 # Close IRC connection if not used by an other bridge, just leave the room otherwise | 289 # Close IRC connection if not used by an other bridge, just leave the room otherwise |
290 self.irc_connection.used_by -= 1 | 290 self.irc_connection.used_by -= 1 |
291 if self.irc_connection.used_by < 1: | 291 if self.irc_connection.used_by < 1: |
292 self.irc_connection.close('Removing bridge') | 292 self.irc_connection.close('Removing bridge', volontary=True) |
293 else: | 293 else: |
294 self.irc_connection.part('Removing bridge') | 294 self.irc_connection.part('Removing bridge') |
295 del self.irc_connection | 295 del self.irc_connection |
296 | 296 |
297 # Leave XMPP room | 297 # Leave XMPP room |