summaryrefslogtreecommitdiffstats
path: root/bridge/mattermost
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-01-10 00:37:09 +0100
committerGitHub <noreply@github.com>2022-01-10 00:37:09 +0100
commit2e8ab119786c689469dd6687c14f7a0e559af811 (patch)
treed08d432fc479d3a0e7534f879c42fc8ca749d822 /bridge/mattermost
parent9a8ce9b17e560433731eb5efa3cee7ced0b93605 (diff)
downloadmatterbridge-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')
-rw-r--r--bridge/mattermost/mattermost.go8
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
+ }
}
}