From 35025e164a3a75ba3074ec509a65d906c01a277b Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 2 Mar 2017 23:51:19 +0100 Subject: Do not forward empty message from any bridge (general). Closes #128 --- gateway/gateway.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gateway') diff --git a/gateway/gateway.go b/gateway/gateway.go index 5e85926e..254fb89f 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -178,6 +178,10 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) { } func (gw *Gateway) ignoreMessage(msg *config.Message) bool { + if msg.Text == "" { + log.Debugf("ignoring empty message %#v from %s", msg, msg.Account) + return true + } for _, entry := range strings.Fields(gw.Bridges[msg.Account].Config.IgnoreNicks) { if msg.Username == entry { log.Debugf("ignoring %s from %s", msg.Username, msg.Account) -- cgit v1.2.3