From 2e8ab119786c689469dd6687c14f7a0e559af811 Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 10 Jan 2022 00:37:09 +0100 Subject: [PATCH] Use current parentID if rootId is not set (mattermost) (#1675) --- bridge/mattermost/mattermost.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go index 4c7c05b5..f1d3db64 100644 --- a/bridge/mattermost/mattermost.go +++ b/bridge/mattermost/mattermost.go @@ -180,13 +180,17 @@ func (b *Bmattermost) Send(msg config.Message) (string, error) { if err != nil { b.Log.Errorf("getting post %s failed: %s", msg.ParentID, err) } - msg.ParentID = post.RootId + if post.RootId != "" { + msg.ParentID = post.RootId + } } else { post, res := b.mc.Client.GetPost(msg.ParentID, "") if res.Error != nil { b.Log.Errorf("getting post %s failed: %s", msg.ParentID, res.Error.DetailedError) } - msg.ParentID = post.RootId + if post.RootId != "" { + msg.ParentID = post.RootId + } } }