commands: Don't show deleted devices in the olm command.
This commit is contained in:
parent
08ad527a1f
commit
d8362c572b
2 changed files with 15 additions and 2 deletions
|
@ -356,7 +356,7 @@ def olm_info_command(server, args):
|
||||||
|
|
||||||
for user_id in sorted(device_store.users):
|
for user_id in sorted(device_store.users):
|
||||||
device_strings = []
|
device_strings = []
|
||||||
for device in device_store[user_id].values():
|
for device in device_store.active_user_devices(user_id):
|
||||||
if filter_regex:
|
if filter_regex:
|
||||||
if (not filter_regex.search(user_id) and
|
if (not filter_regex.search(user_id) and
|
||||||
not filter_regex.search(device.id)):
|
not filter_regex.search(device.id)):
|
||||||
|
@ -454,7 +454,9 @@ def olm_action_command(server, args, category, error_category, prefix, action):
|
||||||
else:
|
else:
|
||||||
users = [x for x in device_store.users if args.user_filter in x]
|
users = [x for x in device_store.users if args.user_filter in x]
|
||||||
|
|
||||||
user_devices = {user: device_store[user].values() for user in users}
|
user_devices = {
|
||||||
|
user: device_store.active_user_devices(user) for user in users
|
||||||
|
}
|
||||||
|
|
||||||
if args.device_filter and args.device_filter != "*":
|
if args.device_filter and args.device_filter != "*":
|
||||||
filtered_user_devices = {}
|
filtered_user_devices = {}
|
||||||
|
|
|
@ -188,6 +188,17 @@ def matrix_olm_device_completion_cb(data, completion_item, buffer, completion):
|
||||||
|
|
||||||
user = fields[1]
|
user = fields[1]
|
||||||
|
|
||||||
|
if user not in olm.device_store.users:
|
||||||
|
return W.WEECHAT_RC_OK
|
||||||
|
|
||||||
|
for device in olm.device_store.active_user_devices(user):
|
||||||
|
W.hook_completion_list_add(
|
||||||
|
completion, device.id, 0, W.WEECHAT_LIST_POS_SORT
|
||||||
|
)
|
||||||
|
|
||||||
|
return W.WEECHAT_RC_OK
|
||||||
|
|
||||||
|
|
||||||
if user not in olm.device_store.users:
|
if user not in olm.device_store.users:
|
||||||
return W.WEECHAT_RC_OK
|
return W.WEECHAT_RC_OK
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue