Merge branch 'kechpaja-master'
This commit is contained in:
commit
137102bb09
1 changed files with 49 additions and 9 deletions
|
@ -144,6 +144,14 @@ class WeechatCommandParser(object):
|
||||||
unblacklist_parser.add_argument("user_filter")
|
unblacklist_parser.add_argument("user_filter")
|
||||||
unblacklist_parser.add_argument("device_filter", nargs="?")
|
unblacklist_parser.add_argument("device_filter", nargs="?")
|
||||||
|
|
||||||
|
ignore_parser = subparsers.add_parser("ignore")
|
||||||
|
ignore_parser.add_argument("user_filter")
|
||||||
|
ignore_parser.add_argument("device_filter", nargs="?")
|
||||||
|
|
||||||
|
unignore_parser = subparsers.add_parser("unignore")
|
||||||
|
unignore_parser.add_argument("user_filter")
|
||||||
|
unignore_parser.add_argument("device_filter", nargs="?")
|
||||||
|
|
||||||
export_parser = subparsers.add_parser("export")
|
export_parser = subparsers.add_parser("export")
|
||||||
export_parser.add_argument("file")
|
export_parser.add_argument("file")
|
||||||
export_parser.add_argument("passphrase")
|
export_parser.add_argument("passphrase")
|
||||||
|
@ -393,34 +401,40 @@ def hook_commands():
|
||||||
"olm",
|
"olm",
|
||||||
"Matrix olm encryption configuration command",
|
"Matrix olm encryption configuration command",
|
||||||
# Synopsis
|
# Synopsis
|
||||||
("info all|blacklisted|private|unverified|verified <filter>||"
|
("info all|blacklisted|ignored|private|unverified|verified <filter>||"
|
||||||
"blacklist <user-id> <device-id> ||"
|
"blacklist <user-id> <device-id> ||"
|
||||||
"unverify <user-id> <device-id> ||"
|
"unverify <user-id> <device-id> ||"
|
||||||
"verify <user-id> <device-id> ||"
|
"verify <user-id> <device-id> ||"
|
||||||
"verification start|accept|cancel|confirm <user-id> <device-id> ||"
|
"verification start|accept|cancel|confirm <user-id> <device-id> ||"
|
||||||
|
"ignore <user-id> <device-id> ||"
|
||||||
|
"unignore <user-id> <device-id> ||"
|
||||||
"export <file-name> <passphrase> ||"
|
"export <file-name> <passphrase> ||"
|
||||||
"import <file-name> <passphrase>"
|
"import <file-name> <passphrase>"
|
||||||
),
|
),
|
||||||
# Description
|
# Description
|
||||||
(" info: show info about known devices and their keys\n"
|
(" info: show info about known devices and their keys\n"
|
||||||
" blacklist: blacklist a device\n"
|
" blacklist: blacklist a device\n"
|
||||||
" unblacklist: unblacklist a device\n"
|
"unblacklist: unblacklist a device\n"
|
||||||
" unverify: unverify a device\n"
|
" unverify: unverify a device\n"
|
||||||
" verify: verify a device\n"
|
" verify: verify a device\n"
|
||||||
|
" ignore: ignore an unverifiable but non-blacklist-worthy device\n"
|
||||||
|
" unignore: unignore a device\n"
|
||||||
"verification: manage interactive device verification\n"
|
"verification: manage interactive device verification\n"
|
||||||
" export: export encryption keys\n"
|
" export: export encryption keys\n"
|
||||||
" import: import encryption keys\n\n"
|
" import: import encryption keys\n\n"
|
||||||
"Examples:"
|
"Examples:"
|
||||||
"\n /olm verify @example:example.com *"
|
"\n /olm verify @example:example.com *"
|
||||||
"\n /olm info all example*"
|
"\n /olm info all example*"
|
||||||
),
|
),
|
||||||
# Completions
|
# Completions
|
||||||
('info all|blacklisted|private|unverified|verified ||'
|
('info all|blacklisted|ignored|private|unverified|verified ||'
|
||||||
'blacklist %(olm_user_ids) %(olm_devices) ||'
|
'blacklist %(olm_user_ids) %(olm_devices) ||'
|
||||||
'unblacklist %(olm_user_ids) %(olm_devices) ||'
|
'unblacklist %(olm_user_ids) %(olm_devices) ||'
|
||||||
'unverify %(olm_user_ids) %(olm_devices) ||'
|
'unverify %(olm_user_ids) %(olm_devices) ||'
|
||||||
'verify %(olm_user_ids) %(olm_devices) ||'
|
'verify %(olm_user_ids) %(olm_devices) ||'
|
||||||
'verification start|accept|cancel|confirm %(olm_user_ids) %(olm_devices) ||'
|
'verification start|accept|cancel|confirm %(olm_user_ids) %(olm_devices) ||'
|
||||||
|
'ignore %(olm_user_ids) %(olm_devices) ||'
|
||||||
|
'unignore %(olm_user_ids) %(olm_devices) ||'
|
||||||
'export %(filename) ||'
|
'export %(filename) ||'
|
||||||
'import %(filename)'
|
'import %(filename)'
|
||||||
),
|
),
|
||||||
|
@ -727,6 +741,28 @@ def olm_unblacklist_command(server, args):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def olm_ignore_command(server, args):
|
||||||
|
olm_action_command(
|
||||||
|
server,
|
||||||
|
args,
|
||||||
|
"Ignored",
|
||||||
|
"ignored",
|
||||||
|
"join",
|
||||||
|
server.client.ignore_device
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def olm_unignore_command(server, args):
|
||||||
|
olm_action_command(
|
||||||
|
server,
|
||||||
|
args,
|
||||||
|
"Unignored",
|
||||||
|
"unignored",
|
||||||
|
"join",
|
||||||
|
server.client.unignore_device
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def olm_export_command(server, args):
|
def olm_export_command(server, args):
|
||||||
file_path = os.path.expanduser(args.file)
|
file_path = os.path.expanduser(args.file)
|
||||||
try:
|
try:
|
||||||
|
@ -822,6 +858,10 @@ def matrix_olm_command_cb(data, buffer, args):
|
||||||
olm_unblacklist_command(server, parsed_args)
|
olm_unblacklist_command(server, parsed_args)
|
||||||
elif parsed_args.subcommand == "verification":
|
elif parsed_args.subcommand == "verification":
|
||||||
olm_sas_command(server, parsed_args)
|
olm_sas_command(server, parsed_args)
|
||||||
|
elif parsed_args.subcommand == "ignore":
|
||||||
|
olm_ignore_command(server, parsed_args)
|
||||||
|
elif parsed_args.subcommand == "unignore":
|
||||||
|
olm_unignore_command(server, parsed_args)
|
||||||
else:
|
else:
|
||||||
message = ("{prefix}matrix: Command not implemented.".format(
|
message = ("{prefix}matrix: Command not implemented.".format(
|
||||||
prefix=W.prefix("error")))
|
prefix=W.prefix("error")))
|
||||||
|
|
Loading…
Reference in a new issue