Fix registration cancellation bug in regproc

This commit is contained in:
Mark Veidemanis 2020-10-31 23:58:03 +00:00
parent fe86d30155
commit fc3a349cb3
2 changed files with 6 additions and 4 deletions

View File

@ -42,7 +42,7 @@ def substitute(net, num, token=None):
def registerAccount(net, num):
debug("Attempting to register: %s - %i" % (net, num))
sinst = substitute(net, num)
if not inst["register"]:
if not sinst["register"]:
error("Cannot register for %s: function disabled" % (net))
return False
name = net+str(num)
@ -68,7 +68,10 @@ def confirmRegistration(net, num, negativepass=None):
return
if name in main.IRCPool.keys():
if main.IRCPool[name]._regAttempt:
try:
main.IRCPool[name]._regAttempt.cancel()
except:
pass
obj.relays[num]["registered"] = True
main.saveConf("network")
@ -102,7 +105,6 @@ def registerTest(c):
return
if inst["ping"]:
if inst["checkmsg2"] in c["msg"] and c["nick"] == inst["entity"]:
print("CHECKMSG2 SUCCEEDED", c["num"])
confirmRegistration(c["net"], c["num"])
return
if inst["checktype"] == "msg":