Properly lowercase host everywhere

This commit is contained in:
Vgr E. Barry 2017-01-13 16:17:03 -05:00
parent a0550f922b
commit fea04471ca
2 changed files with 10 additions and 6 deletions

View File

@ -345,7 +345,7 @@ class User(IRCContext):
return (fnmatch.fnmatch(temp.nick, lower(nick)) and return (fnmatch.fnmatch(temp.nick, lower(nick)) and
fnmatch.fnmatch(temp.ident, lower(ident)) and fnmatch.fnmatch(temp.ident, lower(ident)) and
fnmatch.fnmatch(temp.host, lower(host))) fnmatch.fnmatch(temp.host, lower(host, casemapping="ascii")))
def prefers_notice(self): def prefers_notice(self):
temp = self.lower() temp = self.lower()

View File

@ -488,8 +488,10 @@ def pinger(var, wrapper, message):
def mark_simple_notify(var, wrapper, message): def mark_simple_notify(var, wrapper, message):
"""Makes the bot give you simple role instructions, in case you are familiar with the roles.""" """Makes the bot give you simple role instructions, in case you are familiar with the roles."""
account = users.lower(wrapper.source.account) temp = wrapper.source.lower()
userhost = users.lower(wrapper.source.userhost)
account = temp.account
userhost = temp.userhost
if account is None and var.ACCOUNTS_ONLY: if account is None and var.ACCOUNTS_ONLY:
wrapper.pm(messages["not_logged_in"]) wrapper.pm(messages["not_logged_in"])
@ -512,8 +514,10 @@ def mark_prefer_notice(var, wrapper, message):
# and not an intentional invocation of this command # and not an intentional invocation of this command
return return
account = users.lower(wrapper.source.account) temp = wrapper.source.lower()
userhost = users.lower(wrapper.source.userhost)
account = temp.account
userhost = temp.userhost
if account is None and var.ACCOUNTS_ONLY: if account is None and var.ACCOUNTS_ONLY:
wrapper.pm(messages["not_logged_in"]) wrapper.pm(messages["not_logged_in"])
@ -658,7 +662,7 @@ def join_timer_handler(var):
for num in var.PING_IF_NUMS: for num in var.PING_IF_NUMS:
if num <= len(pl): if num <= len(pl):
for hostmask in var.PING_IF_NUMS[num]: for hostmask in var.PING_IF_NUMS[num]:
checker.add(users.lower(hostmask)) checker.add(users.lower(hostmask, casemapping="ascii"))
# Don't ping alt connections of users that have already joined # Don't ping alt connections of users that have already joined
if not var.DISABLE_ACCOUNTS: if not var.DISABLE_ACCOUNTS: