diff options
author | LuK1337 <priv.luk@gmail.com> | 2018-03-09 16:13:09 +0100 |
---|---|---|
committer | Tollef Fog Heen <tfheen@err.no> | 2018-03-09 19:40:02 +0100 |
commit | b78cea92bfff82358da6289bb6e69e8c6b0ecf88 (patch) | |
tree | 05648f52f60e3461c2f5b641276e5e8cf975f278 /wee_slack.py | |
parent | 221dfc528d7df5460b5d0014d28a6dd6f733ca7b (diff) | |
download | wee-slack-b78cea92bfff82358da6289bb6e69e8c6b0ecf88.tar.gz |
Reorder get_sender bots vs user checks
* Fixes display names for 'app' users,
in before it'd be displayed as "bot :]"
and now it's "-{display name}-".
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/wee_slack.py b/wee_slack.py index 152ebce..582c5c2 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -2003,10 +2003,7 @@ class SlackMessage(object): def get_sender(self): name = "" name_plain = "" - if self.message_json.get('bot_id') in self.team.bots: - name = "{} :]".format(self.team.bots[self.message_json["bot_id"]].formatted_name()) - name_plain = "{}".format(self.team.bots[self.message_json["bot_id"]].formatted_name(enable_color=False)) - elif 'user' in self.message_json: + if 'user' in self.message_json: if self.message_json['user'] == self.team.myidentifier: name = self.team.users[self.team.myidentifier].name name_plain = self.team.users[self.team.myidentifier].name @@ -2023,6 +2020,9 @@ class SlackMessage(object): elif 'service_name' in self.message_json: name = "-{}-".format(self.message_json["service_name"]) name_plain = "{}".format(self.message_json["service_name"]) + elif self.message_json.get('bot_id') in self.team.bots: + name = "{} :]".format(self.team.bots[self.message_json["bot_id"]].formatted_name()) + name_plain = "{}".format(self.team.bots[self.message_json["bot_id"]].formatted_name(enable_color=False)) else: name = "" name_plain = "" |