diff options
author | Wim <wim@42.be> | 2022-01-10 00:37:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-10 00:37:09 +0100 |
commit | 2e8ab119786c689469dd6687c14f7a0e559af811 (patch) | |
tree | d08d432fc479d3a0e7534f879c42fc8ca749d822 /bridge/mattermost/mattermost.go | |
parent | 9a8ce9b17e560433731eb5efa3cee7ced0b93605 (diff) | |
download | matterbridge-msglm-2e8ab119786c689469dd6687c14f7a0e559af811.tar.gz matterbridge-msglm-2e8ab119786c689469dd6687c14f7a0e559af811.tar.bz2 matterbridge-msglm-2e8ab119786c689469dd6687c14f7a0e559af811.zip |
Use current parentID if rootId is not set (mattermost) (#1675)
Diffstat (limited to 'bridge/mattermost/mattermost.go')
-rw-r--r-- | bridge/mattermost/mattermost.go | 8 |
1 files 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 + } } } |