5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-09 16:50:30 +00:00

Send images when text is empty regression. (mattermost). Closes #254

This commit is contained in:
Wim 2017-09-08 00:16:17 +02:00
parent a3470f8aec
commit 9039720013
2 changed files with 8 additions and 0 deletions

View File

@ -195,6 +195,7 @@ func (b *Bmattermost) handleMatter() {
}
rmsg.Text = text
flog.Debugf("Sending message from %s on %s to gateway", message.Username, b.Account)
flog.Debugf("Message is %#v", rmsg)
b.Remote <- rmsg
}
}

View File

@ -277,6 +277,13 @@ func (m *MMClient) WsReceiver() {
// check if we didn't empty the message
if msg.Text != "" {
m.MessageChan <- msg
continue
}
// if we have file attached but the message is empty, also send it
if msg.Post != nil {
if msg.Text != "" || len(msg.Post.FileIds) > 0 {
m.MessageChan <- msg
}
}
continue
}