From 4d24aa236b3125d8bd17a4391cd1e4fa341fc7a6 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 25 Dec 2019 15:57:48 -0800 Subject: [PATCH] exttargets.account: fix extraneous lowercasing of the network name (cherry picked from commit b45fe4c12110fa3d8925a53e5386e8216768da25) --- coremods/exttargets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coremods/exttargets.py b/coremods/exttargets.py index eac97ec..ea2c82d 100644 --- a/coremods/exttargets.py +++ b/coremods/exttargets.py @@ -44,7 +44,7 @@ def account(irc, host, uid): slogin = irc.to_lower(userobj.services_account) # Split the given exttarget host into parts, so we know how many to look for. - groups = list(map(irc.to_lower, host.split(':'))) + groups = host.split(':') log.debug('(%s) exttargets.account: groups to match: %s', irc.name, groups) if len(groups) == 1: @@ -52,12 +52,12 @@ def account(irc, host, uid): return bool(slogin) elif len(groups) == 2: # Second scenario. Return True if the user's account matches the one given. - return slogin == groups[1] and homenet == irc.name + return slogin == irc.to_lower(groups[1]) and homenet == irc.name else: # Third or fourth scenario. If there are more than 3 groups, the rest are ignored. # In other words: Return True if the user is logged in, the query matches either '*' or the # user's login, and the user is connected on the network requested. - return slogin and (groups[1] in ('*', slogin)) and (homenet == groups[2]) + return slogin and (irc.to_lower(groups[1]) in ('*', slogin)) and (homenet == groups[2]) @bind def ircop(irc, host, uid):