Add option to enable threading, with default to off.

This commit is contained in:
Patrick Connolly
2018-10-28 03:10:49 +08:00
parent e094d992c0
commit 043fe02b7e
2 changed files with 2 additions and 1 deletions

View File

@@ -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

View File

@@ -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)
}