comparison participant.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
80 else: 80 else:
81 if error == 'nicknameinuse': 81 if error == 'nicknameinuse':
82 self.bridge.bot.error('===> Debug: "'+self.nickname+'" is already used in the IRC chan of bridge "'+str(self.bridge)+'"', debug=True) 82 self.bridge.bot.error('===> Debug: "'+self.nickname+'" is already used in the IRC chan of bridge "'+str(self.bridge)+'"', debug=True)
83 self.bridge.say('[Warning] The nickname "'+self.nickname+'" is used on both rooms or reserved on the IRC server, please avoid that if possible') 83 self.bridge.say('[Warning] The nickname "'+self.nickname+'" is used on both rooms or reserved on the IRC server, please avoid that if possible')
84 if self.irc_connection != None: 84 if self.irc_connection != None:
85 self.irc_connection.close('') 85 self.irc_connection.close('', volontary=True)
86 self.irc_connection = None 86 self.irc_connection = None
87 elif error == 'erroneusnickname': 87 elif error == 'erroneusnickname':
88 self.bridge.bot.error('===> Debug: "'+self.nickname+'" got "erroneusnickname" on bridge "'+str(self.bridge)+'"', debug=True) 88 self.bridge.bot.error('===> Debug: "'+self.nickname+'" got "erroneusnickname" on bridge "'+str(self.bridge)+'"', debug=True)
89 self.bridge.say('[Warning] The nickname "'+self.nickname+'" contains unauthorized characters and cannot be used in the IRC channel, please avoid that if possible') 89 self.bridge.say('[Warning] The nickname "'+self.nickname+'" contains unauthorized characters and cannot be used in the IRC channel, please avoid that if possible')
90 if self.irc_connection != None: 90 if self.irc_connection != None:
91 self.irc_connection.close('') 91 self.irc_connection.close('', volontary=True)
92 self.irc_connection = None 92 self.irc_connection = None
93 elif error == 'nicknametoolong': 93 elif error == 'nicknametoolong':
94 self.bridge.bot.error('===> Debug: "'+self.nickname+'" got "nicknametoolong" on bridge "'+str(self.bridge)+'"', debug=True) 94 self.bridge.bot.error('===> Debug: "'+self.nickname+'" got "nicknametoolong" on bridge "'+str(self.bridge)+'"', debug=True)
95 self.bridge.say('[Warning] The nickname "'+self.nickname+'" is too long (limit seems to be '+str(arguments[0])+') and cannot be used in the IRC channel, please avoid that if possible') 95 self.bridge.say('[Warning] The nickname "'+self.nickname+'" is too long (limit seems to be '+str(arguments[0])+') and cannot be used in the IRC channel, please avoid that if possible')
96 if self.irc_connection != None: 96 if self.irc_connection != None:
97 self.irc_connection.close('') 97 self.irc_connection.close('', volontary=True)
98 self.irc_connection = None 98 self.irc_connection = None
99 99
100 100
101 def changeNickname(self, newnick, on_protocol): 101 def changeNickname(self, newnick, on_protocol):
102 """Change participant's nickname.""" 102 """Change participant's nickname."""
193 self.muc.leave(message) 193 self.muc.leave(message)
194 self.bridge.bot.close_xmpp_connection(self.nickname) 194 self.bridge.bot.close_xmpp_connection(self.nickname)
195 if self.irc_connection != None: 195 if self.irc_connection != None:
196 self.irc_connection.used_by -= 1 196 self.irc_connection.used_by -= 1
197 if self.irc_connection.used_by < 1: 197 if self.irc_connection.used_by < 1:
198 self.irc_connection.close(message) 198 self.irc_connection.close(message, volontary=True)
199 self.irc_connection = None 199 self.irc_connection = None
200 self.nickname = None 200 self.nickname = None
201 201
202 202
203 def __del__(self): 203 def __del__(self):