summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-03-02 23:51:19 +0100
committerWim <wim@42.be>2017-03-02 23:51:19 +0100
commit35025e164a3a75ba3074ec509a65d906c01a277b (patch)
treeaa24f00a783f14934ae3c47f3589197408b7cb73
parent32bbab8518a03ad04953986f21eeb4832e7331e5 (diff)
downloadmatterbridge-msglm-35025e164a3a75ba3074ec509a65d906c01a277b.tar.gz
matterbridge-msglm-35025e164a3a75ba3074ec509a65d906c01a277b.tar.bz2
matterbridge-msglm-35025e164a3a75ba3074ec509a65d906c01a277b.zip
Do not forward empty message from any bridge (general). Closes #128
-rw-r--r--gateway/gateway.go4
1 files changed, 4 insertions, 0 deletions
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)