Fix lowercasing a hostname to not use IRC lowercasing
This commit is contained in:
parent
4f36b189ff
commit
2cd410ace8
@ -71,10 +71,10 @@ def _send(data, first, sep, client, send_type, name):
|
||||
extra, line = line[:length], line[length:]
|
||||
client.send("{0} {1} :{2}{3}".format(send_type, name, first, extra))
|
||||
|
||||
def lower(nick):
|
||||
def lower(nick, *, host=False):
|
||||
if nick is None:
|
||||
return None
|
||||
if isinstance(nick, IRCContext):
|
||||
if isinstance(nick, IRCContext) or host:
|
||||
return nick.lower()
|
||||
|
||||
mapping = {
|
||||
|
@ -279,7 +279,7 @@ class User(IRCContext):
|
||||
return self._compare(other, __class__, "nick", "ident", "host", "realname", "account")
|
||||
|
||||
def lower(self):
|
||||
temp = type(self)(self.client, lower(self.nick), lower(self.ident), lower(self.host), lower(self.realname), lower(self.account))
|
||||
temp = type(self)(self.client, lower(self.nick), lower(self.ident), lower(self.host, host=True), lower(self.realname), lower(self.account))
|
||||
if temp is not self: # If everything is already lowercase, we'll get back the same instance
|
||||
temp.channels = self.channels
|
||||
temp.ref = self.ref or self
|
||||
@ -573,7 +573,7 @@ class BotUser(User): # TODO: change all the 'if x is Bot' for 'if isinstance(x,
|
||||
temp = type(self)(self.client, lower(self.nick))
|
||||
if temp is not self:
|
||||
temp.ident = lower(self.ident)
|
||||
temp.host = lower(self.host)
|
||||
temp.host = lower(self.host, host=True)
|
||||
temp.realname = lower(self.realname)
|
||||
temp.account = lower(self.account)
|
||||
temp.modes = self.modes
|
||||
|
Loading…
x
Reference in New Issue
Block a user