diff options
author | Aidan Epstein <aidan@jmad.org> | 2020-03-20 20:29:28 -0700 |
---|---|---|
committer | Aidan Epstein <aidan@jmad.org> | 2020-03-21 08:38:39 -0700 |
commit | 2a0ee25f95c13766efa1989dc609ff38f4ed9806 (patch) | |
tree | 1ee66b030e53242aa6b3679ca578e9300bc25e98 /wee_slack.py | |
parent | 90daf70eeba1bd474234e8aec4cef3f2f14c966c (diff) | |
download | wee-slack-2a0ee25f95c13766efa1989dc609ff38f4ed9806.tar.gz |
Fix messages not updating when subscription status changes.
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index 01d68dd..69a4195 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -3230,12 +3230,18 @@ def process_emoji_changed(message_json, eventrouter, team, channel, metadata): def process_thread_subscribed(message_json, eventrouter, team, channel, metadata): dbg("THREAD SUBSCRIBED {}".format(message_json)) - team.channels[message_json["subscription"]["channel"]].messages.get(SlackTS(message_json["subscription"]["thread_ts"])).subscribed = True + channel = team.channels[message_json["subscription"]["channel"]] + parent_ts = message_json["subscription"]["thread_ts"] + channel.messages.get(SlackTS(parent_ts)).subscribed = True + channel.change_message(parent_ts) def process_thread_unsubscribed(message_json, eventrouter, team, channel, metadata): dbg("THREAD UNSUBSCRIBED {}".format(message_json)) - team.channels[message_json["subscription"]["channel"]].messages.get(SlackTS(message_json["subscription"]["thread_ts"])).subscribed = False + channel = team.channels[message_json["subscription"]["channel"]] + parent_ts = message_json["subscription"]["thread_ts"] + channel.messages.get(SlackTS(parent_ts)).subscribed = False + channel.change_message(parent_ts) ###### New module/global methods |