From 52730268b0026d7eb5fc4a23a9bd7d681eec9f6b Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 25 Dec 2019 16:02:26 -0800 Subject: [PATCH] exttarget: use match_text() to match exttarget text fields (cherry picked from commit bfe8a23dbc363aee0813dce9784f03ec87127411) --- coremods/exttargets.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/coremods/exttargets.py b/coremods/exttargets.py index ea2c82d..679ba01 100644 --- a/coremods/exttargets.py +++ b/coremods/exttargets.py @@ -76,8 +76,8 @@ def ircop(irc, host, uid): # 1st scenario. return irc.is_oper(uid) else: - # 2nd scenario. Use match_host (ircmatch) to match the opertype glob to the opertype. - return irc.match_host(groups[1], irc.users[uid].opertype) + # 2nd scenario. Match the opertype glob to the opertype. + return irc.match_text(groups[1], irc.users[uid].opertype) @bind def server(irc, host, uid): @@ -96,7 +96,7 @@ def server(irc, host, uid): sid = irc.get_server(uid) query = groups[1] # Return True if the SID matches the query or the server's name glob matches it. - return sid == query or irc.match_host(query, irc.get_friendly_name(sid)) + return sid == query or irc.match_text(query, irc.get_friendly_name(sid)) # $server alone is invalid. Don't match anything. return False @@ -205,7 +205,7 @@ def realname(irc, host, uid): """ groups = host.split(':') if len(groups) >= 2: - return irc.match_host(groups[1], irc.users[uid].realname) + return irc.match_text(groups[1], irc.users[uid].realname) @bind def service(irc, host, uid): @@ -222,5 +222,5 @@ def service(irc, host, uid): groups = host.split(':') if len(groups) >= 2: - return irc.match_host(groups[1], irc.users[uid].service) + return irc.match_text(groups[1], irc.users[uid].service) return True # It *is* a service bot because of the check at the top.