5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 08:10:26 +00:00

Use current parentID if rootId is not set (mattermost) (#1675)

This commit is contained in:
Wim 2022-01-10 00:37:09 +01:00 committed by GitHub
parent 9a8ce9b17e
commit 2e8ab11978
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,13 +180,17 @@ func (b *Bmattermost) Send(msg config.Message) (string, error) {
if err != nil { if err != nil {
b.Log.Errorf("getting post %s failed: %s", msg.ParentID, err) b.Log.Errorf("getting post %s failed: %s", msg.ParentID, err)
} }
msg.ParentID = post.RootId if post.RootId != "" {
msg.ParentID = post.RootId
}
} else { } else {
post, res := b.mc.Client.GetPost(msg.ParentID, "") post, res := b.mc.Client.GetPost(msg.ParentID, "")
if res.Error != nil { if res.Error != nil {
b.Log.Errorf("getting post %s failed: %s", msg.ParentID, res.Error.DetailedError) b.Log.Errorf("getting post %s failed: %s", msg.ParentID, res.Error.DetailedError)
} }
msg.ParentID = post.RootId if post.RootId != "" {
msg.ParentID = post.RootId
}
} }
} }