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

Handle unthreaded messages (mattermost). Fixes #803

This commit is contained in:
Wim 2019-04-19 23:31:45 +02:00
parent 9b520dfb78
commit fed77cccf3

View File

@ -121,6 +121,12 @@ func (b *Bmattermost) Send(msg config.Message) (string, error) {
return msg.ID, b.mc.DeleteMessage(msg.ID) return msg.ID, b.mc.DeleteMessage(msg.ID)
} }
// Handle prefix hint for unthreaded messages.
if msg.ParentID == "msg-parent-not-found" {
msg.ParentID = ""
msg.Text = fmt.Sprintf("[thread]: %s", msg.Text)
}
// Upload a file if it exists // Upload a file if it exists
if msg.Extra != nil { if msg.Extra != nil {
for _, rmsg := range helper.HandleExtra(&msg, b.General) { for _, rmsg := range helper.HandleExtra(&msg, b.General) {