I've encountered a problem when trying to use a passphrase with spaces in `/olm import`.
The arguments were just broken by spaces. shlex has more advanced splitting which allows
taking multi-word arguments in quotes.
Typing "/olm" on its own is supposed to fall back to the default
subcommand "/olm info private". It does pick up "info", but fails to
find a "category" (in our case: we want "private") because the category
has never been parsed, and has never been assigned to "args". Not only
does the command fail, but it even yields a traceback:
python : stdout/stderr (matrix) : Traceback (most recent call last):
python : stdout/stderr (matrix) : File "/home/qmo/weechat/conf/python/matrix/utf.py", line 89, in wrapper
python : stdout/stderr (matrix) : return function(*args, **kwargs)
python : stdout/stderr (matrix) : File "/home/qmo/weechat/conf/python/matrix/commands.py", line 891, in matrix_olm_command_cb
python : stdout/stderr (matrix) : return command(server, data, buffer, args)
python : stdout/stderr (matrix) : File "/home/qmo/weechat/conf/python/matrix/commands.py", line 860, in command
python : stdout/stderr (matrix) : olm_info_command(server, parsed_args)
python : stdout/stderr (matrix) : File "/home/qmo/weechat/conf/python/matrix/commands.py", line 594, in olm_info_command
python : stdout/stderr (matrix) : if args.category == "private":
python : stdout/stderr (matrix) : AttributeError: 'Namespace' object has no attribute 'category'
Fix it by going for "private" if no category has been assigned.
Fixes: 1208c9d4a2 ("commands: Add initial olm command.")
When passing arguments to format error messages for "/olm verification",
the order of device id and user id has been swapped, leading to
confusing messages. Let's restore the correct order.
Fixes: 9f01a05617 ("commands: Add a command for interactive key verification.")
The address in the config can contain subpaths and it doesn't make sense
for a socket to connect to this address. The net location without the
subpath is now contained in server.address.