From 0b03076a9dd411e567a06f231302f65d95e78c41 Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 19 Apr 2019 23:31:45 +0200 Subject: [PATCH] Handle unthreaded messages (mattermost). Fixes #803 --- bridge/mattermost/mattermost.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go index ce4f4c33..e41b19d7 100644 --- a/bridge/mattermost/mattermost.go +++ b/bridge/mattermost/mattermost.go @@ -121,6 +121,12 @@ func (b *Bmattermost) Send(msg config.Message) (string, error) { return msg.ID, b.mc.DeleteMessage(msg.ID) } + // Handle prefix hint for unthreaded messages. + if msg.ParentID == "msg-parent-not-found" { + msg.ParentID = "" + msg.Text = fmt.Sprintf("[thread]: %s", msg.Text) + } + // Upload a file if it exists if msg.Extra != nil { for _, rmsg := range helper.HandleExtra(&msg, b.General) {