2020-05-30 20:40:10 +00:00
|
|
|
import main
|
|
|
|
from modules import regproc
|
|
|
|
|
2022-07-21 12:39:41 +00:00
|
|
|
|
2020-05-30 20:40:10 +00:00
|
|
|
class ConfirmCommand:
|
|
|
|
def __init__(self, *args):
|
|
|
|
self.confirm(*args)
|
|
|
|
|
2022-07-21 12:40:01 +00:00
|
|
|
def confirm(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
2020-05-30 20:40:10 +00:00
|
|
|
if authed:
|
|
|
|
if length == 4:
|
|
|
|
if not spl[1] in main.network.keys():
|
|
|
|
failure("No such network: %s" % spl[1])
|
|
|
|
return
|
|
|
|
if not spl[2].isdigit():
|
|
|
|
failure("Must be a number, not %s" % spl[2])
|
|
|
|
return
|
|
|
|
if not int(spl[2]) in main.network[spl[1]].relays.keys():
|
2020-11-01 03:36:23 +00:00
|
|
|
failure("No such relay on %s: %s" % (spl[1], spl[2]))
|
2020-05-30 20:40:10 +00:00
|
|
|
return
|
|
|
|
regproc.confirmAccount(spl[1], int(spl[2]), spl[3])
|
2022-07-21 12:40:01 +00:00
|
|
|
success("Requested confirmation on %s - %s with token %s" % (spl[1], spl[2], spl[3]))
|
2020-05-30 20:40:10 +00:00
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage("confirm")
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage(None)
|