summaryrefslogtreecommitdiffstats
path: root/gateway
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-02-03 01:11:11 +0100
committerWim <wim@42.be>2018-02-03 01:11:11 +0100
commit80822b7fff85647ad5852b00ec36d046959aed92 (patch)
treef3f15769f5b75b53f97c3bedf1bbf6a1f9a909c8 /gateway
parent78f1011f529981bab58556d9847488db04d00388 (diff)
downloadmatterbridge-msglm-80822b7fff85647ad5852b00ec36d046959aed92.tar.gz
matterbridge-msglm-80822b7fff85647ad5852b00ec36d046959aed92.tar.bz2
matterbridge-msglm-80822b7fff85647ad5852b00ec36d046959aed92.zip
Send chat notification if media is too big to be re-uploaded to MediaServer. See #359
Diffstat (limited to 'gateway')
-rw-r--r--gateway/gateway.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go
index 93e5b5be..3d0a61ed 100644
--- a/gateway/gateway.go
+++ b/gateway/gateway.go
@@ -171,7 +171,8 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM
dest.Protocol != "mattermost" &&
dest.Protocol != "telegram" &&
dest.Protocol != "matrix" &&
- dest.Protocol != "xmpp" {
+ dest.Protocol != "xmpp" &&
+ len(msg.Extra[config.EVENT_FILE_FAILURE_SIZE]) == 0 {
if msg.Text == "" {
return brMsgIDs
}
@@ -235,7 +236,10 @@ func (gw *Gateway) ignoreMessage(msg *config.Message) bool {
}
if msg.Text == "" {
// we have an attachment or actual bytes
- if msg.Extra != nil && (msg.Extra["attachments"] != nil || len(msg.Extra["file"]) > 0) {
+ if msg.Extra != nil &&
+ (msg.Extra["attachments"] != nil ||
+ len(msg.Extra["file"]) > 0 ||
+ len(msg.Extra[config.EVENT_FILE_FAILURE_SIZE]) > 0) {
return false
}
log.Debugf("ignoring empty message %#v from %s", msg, msg.Account)