mirror of
https://git.wownero.com/wownero/tippero.git
synced 2024-08-15 00:33:14 +00:00
Some more nick canonicalization
This commit is contained in:
parent
7b95991248
commit
fe05261d7c
2 changed files with 6 additions and 5 deletions
|
@ -31,7 +31,7 @@ def GetNick(data): # Return Nickname
|
||||||
nick = nick.replace(':', ' ')
|
nick = nick.replace(':', ' ')
|
||||||
nick = nick.replace(' ', '')
|
nick = nick.replace(' ', '')
|
||||||
nick = nick.strip(' \t\n\r')
|
nick = nick.strip(' \t\n\r')
|
||||||
return nick
|
return nick.lower()
|
||||||
|
|
||||||
class IRCNetwork(Network):
|
class IRCNetwork(Network):
|
||||||
def __init__(self,name):
|
def __init__(self,name):
|
||||||
|
@ -354,7 +354,7 @@ class IRCNetwork(Network):
|
||||||
log_log("New list of users in %s: %s" % (chan, str(self.userstable[chan].keys())))
|
log_log("New list of users in %s: %s" % (chan, str(self.userstable[chan].keys())))
|
||||||
|
|
||||||
elif action == 'KICK':
|
elif action == 'KICK':
|
||||||
nick = parts[3]
|
nick = parts[3].lower()
|
||||||
log_info('%s was kicked' % nick)
|
log_info('%s was kicked' % nick)
|
||||||
removed_list = ""
|
removed_list = ""
|
||||||
for chan in self.userstable:
|
for chan in self.userstable:
|
||||||
|
|
|
@ -236,13 +236,14 @@ def RetrieveBalance(link):
|
||||||
|
|
||||||
def IdentityFromString(link,s):
|
def IdentityFromString(link,s):
|
||||||
if s.find(':') == -1:
|
if s.find(':') == -1:
|
||||||
network = link.network.name
|
network = link.network
|
||||||
nick=s
|
nick=s
|
||||||
else:
|
else:
|
||||||
parts=s.split(':')
|
parts=s.split(':')
|
||||||
network=parts[0]
|
network_name=parts[0]
|
||||||
|
network=GetNetworkByName(network_name)
|
||||||
nick=parts[1]
|
nick=parts[1]
|
||||||
return network+':'+nick
|
return network.name+':'+network.canonicalize(nick)
|
||||||
|
|
||||||
def NickFromIdentity(identity):
|
def NickFromIdentity(identity):
|
||||||
return identity.split(':')[1]
|
return identity.split(':')[1]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue