From 90397200132e3e93d6a7b7c30abad62cd13f83ce Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 8 Sep 2017 00:16:17 +0200 Subject: Send images when text is empty regression. (mattermost). Closes #254 --- matterclient/matterclient.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'matterclient') diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index f2aa44d9..bfaae952 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -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 } -- cgit v1.2.3