Only fetch users when necessary

This commit is contained in:
Midgard 2022-10-26 13:52:51 +02:00
parent 3fd26f6e03
commit d9c81ec68c
Signed by: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -181,8 +181,8 @@ def cat(mm_api: mattermost.MMApi, cmdline_args):
# ] # ]
team, channel = resolve_team_channel(mm_api, cmdline_args.channel) team, channel = resolve_team_channel(mm_api, cmdline_args.channel)
users = list(mm_api.get_users())
if not cmdline_args.ids: if not cmdline_args.ids:
users = list(mm_api.get_users())
def attribute(key_value): def attribute(key_value):
key, value = key_value key, value = key_value
if key == "channel_id": if key == "channel_id":