Skip to content

Commit

Permalink
Reaction: state that it was applied to correct message
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdecook committed Aug 20, 2022
1 parent 16852e3 commit a80de4d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/ircslack/event_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,17 @@ func getConversationDetails(
return slack.Message{}, err
}
if len(message.Messages) > 0 {
// If the timestamps are not equal, we're looking for a threaded message
if message.Messages[0].Timestamp != timestamp {
msgs, _, _, err := ctx.SlackClient.GetConversationReplies(&slack.GetConversationRepliesParameters{ ChannelID: channelID, Timestamp: message.Messages[0].Timestamp })
if err == nil {
for _, msg := range msgs {
if msg.Timestamp == timestamp { return msg, nil }
}
}
// TODO: Always find the message, or return better fallback
log.Warningf("Did not find threaded message with timestamp %v from %v", timestamp, message.Messages[0]);
}
return message.Messages[0], nil
}
return slack.Message{}, fmt.Errorf("No such message found")
Expand Down

0 comments on commit a80de4d

Please sign in to comment.