From fed77cccf3ca8104c60ffedbff130a1e520abfb7 Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 19 Apr 2019 23:31:45 +0200 Subject: Handle unthreaded messages (mattermost). Fixes #803 --- bridge/mattermost/mattermost.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bridge/mattermost') 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) { -- cgit v1.2.3