Skip to content

Commit

Permalink
Use current parentID if rootId is not set (mattermost)
Browse files Browse the repository at this point in the history
  • Loading branch information
42wim committed Jan 9, 2022
1 parent 9a8ce9b commit 3cd19a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bridge/mattermost/mattermost.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down

0 comments on commit 3cd19a1

Please sign in to comment.