summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bridge/mattermost/mattermost.go1
-rw-r--r--matterclient/matterclient.go7
2 files changed, 8 insertions, 0 deletions
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go
index fc4fdb96..30e38042 100644
--- a/bridge/mattermost/mattermost.go
+++ b/bridge/mattermost/mattermost.go
@@ -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
}
}
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
}