Thumbnail

rani/matterbridge.git

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

commit 43237f8f7b577463afadeaa924b1c760445d7f8a Author: Wim <wim@42.be> Date: Sun Nov 12 18:34:16 2017 +0000 Do not ignore empty messages with files for bridges that support it diff --git a/gateway/gateway.go b/gateway/gateway.go index cdd8247..e1a6c9c 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -1527 +15210 @@ 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   } @@ -2108 +2138 @@ 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)