aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2022-01-31 11:50:44 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2022-01-31 11:50:44 +0100
commit76c1d0977b528e2030e02693b2e11de54ac4d44a (patch)
treeb79baf322642d574137be27653a20e2be2ff2b96
parent4051adc5c80f617fef6838267f382415f07c023a (diff)
downloadwee-slack-76c1d0977b528e2030e02693b2e11de54ac4d44a.tar.gz
Fix message changes not being processed
The Slack API has changed message_changed events from having a unique ts to having the ts of the message that's changed, which means that the condition in the start of process_message to not process duplicate messages (see commit 68966be for info about that) made it skip the message_changed events. To fix this, only do this duplication check for messages without a subtype (i.e. new normal messages). This condition is becoming a bit convoluted, so it might be better to do this duplication check another way, but this will have to do for now to get the issue fixed.
-rw-r--r--wee_slack.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index cf2fb49..0ce5026 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -4003,14 +4003,15 @@ def process_pong(message_json, eventrouter, team, channel, metadata):
def process_message(
message_json, eventrouter, team, channel, metadata, history_message=False
):
+ subtype = message_json.get("subtype")
if (
not history_message
+ and not subtype
and "ts" in message_json
and SlackTS(message_json["ts"]) in channel.messages
):
return
- subtype = message_json.get("subtype")
subtype_functions = get_functions_with_prefix("subprocess_")
if "thread_ts" in message_json and "reply_count" not in message_json: