mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-22 09:20:27 +00:00
Use current parentID if rootId is not set (mattermost) (#1675)
This commit is contained in:
parent
9a8ce9b17e
commit
2e8ab11978
@ -180,15 +180,19 @@ 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)
|
||||||
}
|
}
|
||||||
|
if post.RootId != "" {
|
||||||
msg.ParentID = 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)
|
||||||
}
|
}
|
||||||
|
if post.RootId != "" {
|
||||||
msg.ParentID = post.RootId
|
msg.ParentID = post.RootId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Upload a file if it exists
|
// Upload a file if it exists
|
||||||
if msg.Extra != nil {
|
if msg.Extra != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user