From 8cebf955ad71975a20275a780a67b31099759e3a Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Tue, 18 Jul 2017 15:43:35 +0200 Subject: [feat] add a mock mixnet_status call to the API For now we say it will be mixed on every request if the mixnet is enabled. We might want a better mock in the future. - Resolves: #8972 --- src/leap/bitmask/cli/mail.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/leap/bitmask/cli') diff --git a/src/leap/bitmask/cli/mail.py b/src/leap/bitmask/cli/mail.py index 1624606a..21b93c24 100644 --- a/src/leap/bitmask/cli/mail.py +++ b/src/leap/bitmask/cli/mail.py @@ -20,8 +20,6 @@ Bitmask Command Line interface: mail import argparse import sys -from colorama import Fore - from leap.bitmask.cli import command @@ -58,3 +56,22 @@ SUBCOMMANDS: self.data += ['status', uid] return self._send(command.print_status) + + def mixnet_status(self, raw_args): + parser = argparse.ArgumentParser( + description='Bitmask mixnet status', + prog='%s %s %s' % tuple(sys.argv[:3])) + parser.add_argument('-u', '--userid', default='', + help='uid to check the status of') + parser.add_argument('address', nargs=1, + help='the recipient address') + subargs = parser.parse_args(raw_args) + + userid = None + if subargs.userid: + userid = subargs.userid + else: + userid = self.cfg.get('bonafide', 'active', default=None) + self.data += ['mixnet_status', userid, subargs.address[0]] + + return self._send(command.default_dict_printer) -- cgit v1.2.3