diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-06-01 22:06:47 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-06-02 23:09:20 +0200 |
commit | 20456e353d3a34bd6395f771edde0d816c922cea (patch) | |
tree | 627a9dc62b10798ae72e54b5f0f22d531f99d09a /wee_slack.py | |
parent | 38d523ad8efa8b6d4bbe22b117c9387afcc22721 (diff) | |
download | wee-slack-20456e353d3a34bd6395f771edde0d816c922cea.tar.gz |
Print status in whois when either emoji or text is set
Previously, it was only printed if the status text was set.
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/wee_slack.py b/wee_slack.py index 05ddbe8..b4f69ec 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -3492,7 +3492,7 @@ def topic_command_cb(data, current_buffer, command): def whois_command_cb(data, current_buffer, command): """ Get real name of user - /whois <display_name> + /whois <nick> """ args = command.split() if len(args) < 2: @@ -3505,9 +3505,10 @@ def whois_command_cb(data, current_buffer, command): u = team.users.get(team.get_username_map().get(user)) if u: team.buffer_prnt("[{}]: {}".format(user, u.real_name)) - if u.profile.get("status_text"): - team.buffer_prnt("[{}]: {} {}".format(user, u.profile.get('status_emoji', ''), u.profile.get('status_text', ''))) - team.buffer_prnt("[{}]: Real name: {}".format(user, u.profile.get('real_name_normalized', ''))) + status_emoji = u.profile.get("status_emoji", "") + status_text = u.profile.get("status_text", "") + if status_emoji or status_text: + team.buffer_prnt("[{}]: {} {}".format(user, status_emoji, status_text)) team.buffer_prnt("[{}]: Title: {}".format(user, u.profile.get('title', ''))) team.buffer_prnt("[{}]: Email: {}".format(user, u.profile.get('email', ''))) team.buffer_prnt("[{}]: Phone: {}".format(user, u.profile.get('phone', ''))) |