From 9959231d5093cc2287498addd916d62245d9e8de Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sun, 1 Nov 2020 22:19:03 +0000 Subject: [PATCH] Use substitutions in registration tests --- modules/regproc.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/regproc.py b/modules/regproc.py index 0cdb1c9..97c330a 100644 --- a/modules/regproc.py +++ b/modules/regproc.py @@ -88,32 +88,32 @@ def enableAuthentication(net, num): confirmRegistration(net, num) def registerTest(c): - inst = selectInst(c["net"]) + sinst = substitute(c["net"], c["num"]) name = c["net"]+str(c["num"]) - if inst["check"] == False: + if sinst["check"] == False: return if "msg" in c.keys() and not c["msg"] == None: - if inst["negative"]: + if sinst["negative"]: if name in main.IRCPool.keys(): if not main.IRCPool[name]._negativePass == True: - if c["type"] == "query" and c["nick"] == inst["entity"]: - if inst["checknegativemsg"] in c["msg"]: + if c["type"] == "query" and c["nick"] == sinst["entity"]: + if sinst["checknegativemsg"] in c["msg"]: confirmRegistration(c["net"], c["num"], negativepass=False) # Not passed negative check, report back return - if inst["checkendnegative"] in c["msg"]: + if sinst["checkendnegative"] in c["msg"]: confirmRegistration(c["net"], c["num"], negativepass=True) # Passed the negative check, report back return - if inst["ping"]: - if inst["checkmsg2"] in c["msg"] and c["nick"] == inst["entity"]: + if sinst["ping"]: + if sinst["checkmsg2"] in c["msg"] and c["nick"] == sinst["entity"]: confirmRegistration(c["net"], c["num"]) return - if inst["checktype"] == "msg": - if inst["checkmsg"] in c["msg"]: + if sinst["checktype"] == "msg": + if sinst["checkmsg"] in c["msg"]: confirmRegistration(c["net"], c["num"]) return - elif inst["checktype"] == "mode": + elif sinst["checktype"] == "mode": if c["type"] == "self": if c["mtype"] == "mode": - if inst["checkmode"] in c["mode"] and c["status"] == True: + if sinst["checkmode"] in c["mode"] and c["status"] == True: confirmRegistration(c["net"], c["num"]) return