From 043fe02b7e0c5a31be8f875b8718089c1ceb56ee Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Sun, 28 Oct 2018 03:10:49 +0800 Subject: [PATCH] Add option to enable threading, with default to off. --- bridge/config/config.go | 1 + gateway/gateway.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bridge/config/config.go b/bridge/config/config.go index 677fde11..5ccf6041 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -99,6 +99,7 @@ type Protocol struct { NoTLS bool // mattermost Password string // IRC,mattermost,XMPP,matrix PrefixMessagesWithNick bool // mattemost, slack + PreserveThreading bool // slack Protocol string // all protocols QuoteDisable bool // telegram QuoteFormat string // telegram diff --git a/gateway/gateway.go b/gateway/gateway.go index f276bb64..32c28617 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -263,7 +263,7 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM // Get the ID of the parent message in thread var canonicalParentMsgID string - if msg.ParentID != "" { + if msg.ParentID != "" && (gw.Config.General.PreserveThreading || dest.GetBool("PreserveThreading")) { thisParentMsgID := dest.Protocol + " " + msg.ParentID canonicalParentMsgID = gw.FindCanonicalMsgID(thisParentMsgID) }