Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 467efbf7d8232037270332c9aa67b02c374d9bf7 Author: Wim <wim@42.be> Date: Mon Jan 10 00:37:09 2022 +0000 Use current parentID if rootId is not set (mattermost) (#1675) diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go index 4c7c05b..f1d3db6 100644 --- a/bridge/mattermost/mattermost.go +++ b/bridge/mattermost/mattermost.go @@ -18013 +18017 @@ 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 + }   }   }