2020-05-31 11:32:12 +00:00
|
|
|
import main
|
|
|
|
|
2022-07-21 12:39:41 +00:00
|
|
|
|
2020-05-31 11:32:12 +00:00
|
|
|
class PendingCommand:
|
|
|
|
def __init__(self, *args):
|
|
|
|
self.pending(*args)
|
|
|
|
|
2022-09-05 06:20:30 +00:00
|
|
|
def pending(
|
|
|
|
self, addr, authed, data, obj, spl, success, failure, info, incUsage, length
|
|
|
|
):
|
2020-05-31 11:32:12 +00:00
|
|
|
if authed:
|
|
|
|
if length == 1:
|
|
|
|
results = []
|
|
|
|
for i in main.network.keys():
|
|
|
|
for x in main.network[i].relays.keys():
|
|
|
|
if not main.network[i].relays[x]["registered"]:
|
2022-09-05 06:20:30 +00:00
|
|
|
results.append(
|
|
|
|
"%s: confirm %s %s [code]"
|
|
|
|
% (main.alias[x]["nick"], i, x)
|
|
|
|
)
|
2020-05-31 11:32:12 +00:00
|
|
|
info("\n".join(results))
|
|
|
|
return
|
|
|
|
elif length == 2:
|
|
|
|
if not spl[1] in main.network.keys():
|
|
|
|
failure("No such network: %s" % spl[1])
|
|
|
|
return
|
|
|
|
results = []
|
|
|
|
for x in main.network[spl[1]].relays.keys():
|
|
|
|
if not main.network[spl[1]].relays[x]["registered"]:
|
2022-09-05 06:20:30 +00:00
|
|
|
results.append(
|
|
|
|
"%s: confirm %s %s [code]"
|
|
|
|
% (main.alias[x]["nick"], spl[1], x)
|
|
|
|
)
|
2020-05-31 11:32:12 +00:00
|
|
|
info("\n".join(results))
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage("pending")
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage(None)
|