Preserve ThreadTimestamp from SubMessage for edits.

Since we're using ThreadTimestamp and ParentID to know if original message is threaded, we need to extract it from SubMessage for edits.
This commit is contained in:
Patrick Connolly
2018-11-29 01:57:27 +08:00
parent 17343be4c3
commit fdbc1191b2

View File

@@ -189,6 +189,13 @@ func (b *Bslack) populateReceivedMessage(ev *slack.MessageEvent) (*config.Messag
}
}
// For edits, only submessage has thread ts.
// Ensures edits to threaded messages maintain their prefix hint on the
// unthreaded end.
if ev.SubMessage != nil {
rmsg.ParentID = ev.SubMessage.ThreadTimestamp
}
if err = b.populateMessageWithUserInfo(ev, rmsg); err != nil {
return nil, err
}