comparison participant.py @ 31:5afa22125334

Changed participant's IRC nickname callback function. Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Fri, 21 Aug 2009 17:12:09 +0200
parents a694ffe6a973
children b048c4c03b00
comparison
equal deleted inserted replaced
30:c0fb916cb0a0 31:5afa22125334
78 self.bridge.bot.error('===> Debug: "'+self.nickname+'" duplicate succesfully created on IRC side of bridge "'+str(self.bridge)+'"', debug=True) 78 self.bridge.bot.error('===> Debug: "'+self.nickname+'" duplicate succesfully created on IRC side of bridge "'+str(self.bridge)+'"', debug=True)
79 else: 79 else:
80 if error == 'nicknameinuse': 80 if error == 'nicknameinuse':
81 self.bridge.bot.error('===> Debug: "'+self.nickname+'" is already used in the IRC chan of bridge "'+str(self.bridge)+'"', debug=True) 81 self.bridge.bot.error('===> Debug: "'+self.nickname+'" is already used in the IRC chan of bridge "'+str(self.bridge)+'"', debug=True)
82 self.bridge.say('[Warning] The nickname "'+self.nickname+'" is used on both rooms or reserved on the IRC server, please avoid that if possible') 82 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.irc_connection.close('') 83 if self.irc_connection != None:
84 self.irc_connection = None 84 self.irc_connection.close('')
85 self.irc_connection = None
85 elif error == 'erroneusnickname': 86 elif error == 'erroneusnickname':
86 self.bridge.bot.error('===> Debug: "'+self.nickname+'" got "erroneusnickname" on bridge "'+str(self.bridge)+'"', debug=True) 87 self.bridge.bot.error('===> Debug: "'+self.nickname+'" got "erroneusnickname" on bridge "'+str(self.bridge)+'"', debug=True)
87 self.bridge.say('[Warning] The nickname "'+self.nickname+'" contains unauthorized characters and cannot be used in the IRC channel, please avoid that if possible') 88 self.bridge.say('[Warning] The nickname "'+self.nickname+'" contains unauthorized characters and cannot be used in the IRC channel, please avoid that if possible')
88 self.irc_connection.close('') 89 if self.irc_connection != None:
89 self.irc_connection = None 90 self.irc_connection.close('')
91 self.irc_connection = None
90 elif error == 'nicknametoolong': 92 elif error == 'nicknametoolong':
91 self.bridge.bot.error('===> Debug: "'+self.nickname+'" got "nicknametoolong" on bridge "'+str(self.bridge)+'"', debug=True) 93 self.bridge.bot.error('===> Debug: "'+self.nickname+'" got "nicknametoolong" on bridge "'+str(self.bridge)+'"', debug=True)
92 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') 94 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')
93 self.irc_connection.close('') 95 if self.irc_connection != None:
94 self.irc_connection = None 96 self.irc_connection.close('')
97 self.irc_connection = None
95 98
96 99
97 def changeNickname(self, newnick, on_protocol): 100 def changeNickname(self, newnick, on_protocol):
98 """Change participant's nickname.""" 101 """Change participant's nickname."""
99 102