aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2019-08-25 19:35:32 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2019-08-25 19:45:18 +0200
commitcfaa6ad2e4f27d89a8a671671cc0a2eb33f7021d (patch)
tree0b3d965bdab1c66ef12f76bbd18f8ab8ac4e761c /wee_slack.py
parent1579546c4eaed2ff782cf7844b30bd73ce463c30 (diff)
downloadwee-slack-cfaa6ad2e4f27d89a8a671671cc0a2eb33f7021d.tar.gz
Show if user is external in /slack users
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 0cb575c..bcc455a 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -2784,7 +2784,7 @@ def handle_usergroupsuserslist(users_json, eventrouter, **kwargs):
team = eventrouter.teams[request_metadata.team_hash]
header = 'Users in {}'.format(request_metadata.usergroup_handle)
users = [team.users[key] for key in users_json['users']]
- return print_team_items_info(team, header, users, lambda user: user.presence)
+ return print_users_info(team, header, users)
def handle_usersprofileset(json, eventrouter, **kwargs):
@@ -3804,6 +3804,13 @@ def print_team_items_info(team, header, items, extra_info_function):
return w.WEECHAT_RC_OK_EAT
+def print_users_info(team, header, users):
+ def extra_info_function(user):
+ external_text = ", external" if user.is_external else ""
+ return user.presence + external_text
+ return print_team_items_info(team, header, users, extra_info_function)
+
+
@slack_buffer_required
@utf8_decode
def command_channels(data, current_buffer, args):
@@ -3831,7 +3838,7 @@ def command_users(data, current_buffer, args):
List the users in the current team.
"""
team = EVENTROUTER.weechat_controller.buffers[current_buffer].team
- return print_team_items_info(team, "Users", team.users.values(), lambda user: user.presence)
+ return print_users_info(team, "Users", team.users.values())
@slack_buffer_required