diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2020-04-22 01:03:19 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2020-05-30 21:13:20 +0200 |
commit | 101ba86896ab7179964cd44a8a10ac03a2a02e86 (patch) | |
tree | be8748ab75a3f035e3aac7157d5fa948fa7d33ec /wee_slack.py | |
parent | 8beb6385d7d18c0706e3d2790a2ec6db0ced6015 (diff) | |
download | wee-slack-101ba86896ab7179964cd44a8a10ac03a2a02e86.tar.gz |
Only append to submessages if ts isn't there
I don't think we would ever get the same thread message twice (unless we
call /rehistory -remote, but that processes the parent message again
too, so submessages is created again), but it is more robust to only
append ts's which are not in the list already.
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index b2d2784..33c7ae0 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -3167,7 +3167,8 @@ def subprocess_thread_message(message_json, eventrouter, team, channel, history_ parent_message = channel.messages.get(SlackTS(parent_ts)) if parent_message: message = SlackThreadMessage(parent_message, message_json, team, channel) - parent_message.submessages.append(message.ts) + if message.ts not in parent_message.submessages: + parent_message.submessages.append(message.ts) channel.hash_message(parent_ts) channel.change_message(parent_ts) |