From 9e62ac62bce6feb60efc16ef1f50375126ea0b1a Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sun, 31 May 2020 12:32:12 +0100 Subject: [PATCH] Add confirm command Confirm command to check which relays need manual confirmation. --- commands/pending.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 commands/pending.py diff --git a/commands/pending.py b/commands/pending.py new file mode 100644 index 0000000..a245a52 --- /dev/null +++ b/commands/pending.py @@ -0,0 +1,31 @@ +import main + +class PendingCommand: + def __init__(self, *args): + self.pending(*args) + + def pending(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length): + 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"]: + results.append("%s: confirm %s %s [code]" % (main.alias[x]["nick"], i, x)) + 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"]: + results.append("%s: confirm %s %s [code]" % (main.alias[x]["nick"], spl[1], x)) + info("\n".join(results)) + return + else: + incUsage("pending") + return + else: + incUsage(None)