aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2018-08-23 23:01:19 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2018-08-23 23:07:50 +0200
commit1bbfd244ef9177dbcd2ea6600869e85e18d0f85a (patch)
tree3a9ac103e072b356be603f17382a598eda3c2abd
parente0b4abb28da99882cc86e41140534cbe46454c9c (diff)
downloadwee-slack-1bbfd244ef9177dbcd2ea6600869e85e18d0f85a.tar.gz
Show inviter for join events
Fixes #538
-rw-r--r--wee_slack.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 20133ce..7126fcd 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -2124,9 +2124,13 @@ class SlackMessage(object):
if (self.message_json.get('subtype') == 'me_message' and
not self.message_json['text'].startswith(self.sender)):
text = "{} {}".format(self.sender, text)
+ if (self.message_json.get('subtype') == 'channel_join' and
+ self.message_json.get('inviter')):
+ inviter_id = self.message_json.get('inviter')
+ inviter_nick = unfurl_refs("<@{}>".format(inviter_id))
+ text += " by invitation from {}".format(inviter_nick)
if len(self.submessages) > 0:
- text = "{} {}[ Thread: {} Replies: {} ]".format(
- text,
+ text += " {}[ Thread: {} Replies: {} ]".format(
w.color(config.thread_suffix_color),
self.hash or self.ts,
len(self.submessages))