diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-10-01 18:51:31 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-10-01 18:51:31 +0200 |
commit | 9fec71d8096919481438c62a1a1baaf21c62456d (patch) | |
tree | e9bd105789e2284533c4af6b82c5fb2dbba4f70d | |
parent | c104c8bf516ee650c3a009fff047d93b273f615a (diff) | |
download | wee-slack-9fec71d8096919481438c62a1a1baaf21c62456d.tar.gz |
Print thread broadcast messages in parent channel
Fixes #620
-rw-r--r-- | wee_slack.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/wee_slack.py b/wee_slack.py index d89945e..709c867 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -2900,7 +2900,7 @@ def process_message(message_json, eventrouter, store=True, history_message=False if SlackTS(message_json["ts"]) in channel.messages: return - if "thread_ts" in message_json and "reply_count" not in message_json: + if "thread_ts" in message_json and "reply_count" not in message_json and "subtype" not in message_json: message_json["subtype"] = "thread_message" subtype = message_json.get("subtype") @@ -2969,6 +2969,10 @@ def download_files(message_json, **kwargs): break +def subprocess_thread_broadcast(message_json, eventrouter, channel, team, history_message): + subprocess_thread_message(message_json, eventrouter, channel, team, history_message) + + def subprocess_thread_message(message_json, eventrouter, channel, team, history_message): # print ("THREADED: " + str(message_json)) parent_ts = message_json.get('thread_ts') @@ -2987,14 +2991,15 @@ def subprocess_thread_message(message_json, eventrouter, channel, team, history_ elif message.ts > channel.last_read and message.has_mention(): parent_message.notify_thread(action="mention", sender_id=message_json["user"]) - if config.thread_messages_in_channel: + if config.thread_messages_in_channel or message_json["subtype"] == "thread_broadcast": + thread_tag = "thread_broadcast" if message_json["subtype"] == "thread_broadcast" else "thread_message" channel.buffer_prnt( message.sender, channel.render(message), message.ts, tag_nick=message.sender_plain, history_message=history_message, - extra_tags=["thread_message"], + extra_tags=[thread_tag], ) # channel = channels.find(message_json["channel"]) |