diff options
Diffstat (limited to 'gateway/gateway.go')
-rw-r--r-- | gateway/gateway.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go index d09741fa..7c1f3bd9 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -147,6 +147,17 @@ func (gw *Gateway) getDestChannel(msg *config.Message, dest bridge.Bridge) []con func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrMsgID { var brMsgIDs []*BrMsgID + + // TODO refactor + // 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 msg.Text == "" { + return brMsgIDs + } + } + } // only relay join/part when configged if msg.Event == config.EVENT_JOIN_LEAVE && !gw.Bridges[dest.Account].Config.ShowJoinPart { return brMsgIDs @@ -199,6 +210,10 @@ func (gw *Gateway) ignoreMessage(msg *config.Message) bool { return true } if msg.Text == "" { + // we have an attachment + if msg.Extra != nil { + return false + } log.Debugf("ignoring empty message %#v from %s", msg, msg.Account) return true } |