fix users.match_hostmask only working on full hostmasks

fixes admins list in botconfig.py when DISABLE_ACCOUNTS is true
This commit is contained in:
jacob1 2017-02-24 23:49:56 -05:00
parent c615a62f9d
commit bc6375cf24

View File

@ -350,8 +350,8 @@ class User(IRCContext):
nick, ident, host = re.match("(?:(?:(.*?)!)?(.*?)@)?(.*)", hostmask).groups("")
temp = self.lower()
return (fnmatch.fnmatch(temp.nick, lower(nick)) and
fnmatch.fnmatch(temp.ident, lower(ident)) and
return ((not nick or fnmatch.fnmatch(temp.nick, lower(nick))) and
(not ident or fnmatch.fnmatch(temp.ident, lower(ident))) and
fnmatch.fnmatch(temp.host, lower(host, casemapping="ascii")))
def prefers_notice(self):