From a20b7895a9414882934d0160daefd5e6ef888a24 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Wed, 7 Nov 2018 16:14:31 +0800 Subject: Preserve threading between Slack instances (#529) * Opportunistically preserve Slack threading when parent thread in cache. [#529] * Removed slack-specific processing from gateway. * Added docs. * Add option to enable threading, with default to off. * Did cleanup on @42wim's comments. * Update gateway/gateway.go Co-Authored-By: patcon * Suggestion from @42wim :) * Suggestions from @42wim. * More suggestions. --- bridge/slack/slack.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bridge/slack/slack.go') diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 2022ebce..d2d118b2 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -310,6 +310,10 @@ func (b *Bslack) prepareMessageParameters(msg *config.Message) *slack.PostMessag params.Username = msg.Username params.LinkNames = 1 // replace mentions params.IconURL = config.GetIconURL(msg, b.GetString(iconURLConfig)) + msgFields := strings.Fields(msg.ParentID) + if len(msgFields) >= 2 { + params.ThreadTimestamp = msgFields[1] + } if msg.Avatar != "" { params.IconURL = msg.Avatar } -- cgit v1.2.3