From 2732cc82d6a2508b348c1c7527063122ad7bc65f Mon Sep 17 00:00:00 2001 From: jspc Date: Sun, 25 Sep 2022 19:47:57 +0100 Subject: [PATCH] Mark 'recently sent' on response from slack We run into a weird situation where: 1. Recipient (R) sends a message to the bot at 1200 (for example) 2. Advisor (A) sends a resonse to the bot at 1231 3. R sends a message back at 1232 4. Bot (B) sends a thank you message In this situation R and A are in an active conversation, yet B sends a response as if R has just initiated a response. This is because as far as B is concerned, it has been over 30 minutes since the last message. In this situation, then, we reset the 'Thank you' response on all responses; whether from R or A. This removes the absurdity --- client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client.go b/client.go index f32d80b..498062a 100644 --- a/client.go +++ b/client.go @@ -202,6 +202,8 @@ func (c Client) HandleResponse(msg Message) (err error) { Conversation: stringRef(msg.Message), }) + c.r.MarkRecentlySent(thankyouKey(msg.ID), time.Minute*30) + return }