Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 5fc759bc9542fccec0bc28dfd18f64139de98d0a Author: Wim <wim@42.be> Date: Fri Sep 08 00:16:17 2017 +0000 Send images when text is empty regression. (mattermost). Closes #254 diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go index fc4fdb9..30e3804 100644 --- a/bridge/mattermost/mattermost.go +++ b/bridge/mattermost/mattermost.go @@ -1956 +1957 @@ 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   }  } diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index f2aa44d..bfaae95 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -2776 +27713 @@ 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   }