5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 07:00:27 +00:00

Do not forward empty message from any bridge (general). Closes #128

This commit is contained in:
Wim 2017-03-02 23:51:19 +01:00
parent 32bbab8518
commit 35025e164a

View File

@ -178,6 +178,10 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) {
} }
func (gw *Gateway) ignoreMessage(msg *config.Message) bool { 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) { for _, entry := range strings.Fields(gw.Bridges[msg.Account].Config.IgnoreNicks) {
if msg.Username == entry { if msg.Username == entry {
log.Debugf("ignoring %s from %s", msg.Username, msg.Account) log.Debugf("ignoring %s from %s", msg.Username, msg.Account)