summaryrefslogtreecommitdiffstats
path: root/gateway
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-11-12 18:34:16 +0100
committerWim <wim@42.be>2017-11-12 18:34:16 +0100
commitf1e98333106492b489fc0cd25d485b4dc569cff9 (patch)
treed01d710f668296cc7766bea450429c66fd58fb97 /gateway
parent46f5acc4f93bec66e868cac77e2be30550614e4e (diff)
downloadmatterbridge-msglm-f1e98333106492b489fc0cd25d485b4dc569cff9.tar.gz
matterbridge-msglm-f1e98333106492b489fc0cd25d485b4dc569cff9.tar.bz2
matterbridge-msglm-f1e98333106492b489fc0cd25d485b4dc569cff9.zip
Do not ignore empty messages with files for bridges that support it
Diffstat (limited to 'gateway')
-rw-r--r--gateway/gateway.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go
index cdd8247e..e1a6c9cb 100644
--- a/gateway/gateway.go
+++ b/gateway/gateway.go
@@ -152,7 +152,10 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM
// only slack now, check will have to be done in the different bridges.
// we need to check if we can't use fallback or text in other bridges
if msg.Extra != nil {
- if dest.Protocol != "slack" {
+ if dest.Protocol != "discord" &&
+ dest.Protocol != "slack" &&
+ dest.Protocol != "mattermost" &&
+ dest.Protocol != "telegram" {
if msg.Text == "" {
return brMsgIDs
}
@@ -210,8 +213,8 @@ func (gw *Gateway) ignoreMessage(msg *config.Message) bool {
return true
}
if msg.Text == "" {
- // we have an attachment
- if msg.Extra != nil && msg.Extra["attachments"] != nil {
+ // we have an attachment or actual bytes
+ if msg.Extra != nil && (msg.Extra["attachments"] != nil || len(msg.Extra["file"]) > 0) {
return false
}
log.Debugf("ignoring empty message %#v from %s", msg, msg.Account)