From 1f895db149846f9fc2548fc39baab5c04a518b4e Mon Sep 17 00:00:00 2001 From: Hugo Thunnissen Date: Sat, 15 Feb 2020 10:34:19 +0100 Subject: [PATCH] Move rejection of info messages to "Accepts" method of botcommand --- botcommands/whapp-bridge.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/botcommands/whapp-bridge.go b/botcommands/whapp-bridge.go index a9453a5..59359e0 100644 --- a/botcommands/whapp-bridge.go +++ b/botcommands/whapp-bridge.go @@ -30,7 +30,9 @@ func (b *WhappBridge) Accepts(c *deltachat.Chat, m *deltachat.Message) bool { return false } - return chatJID != nil + // Only forward messages for known groups, + // Don't forward info messages like "group name changed" etc. + return chatJID != nil && !m.IsInfo() } func (b *WhappBridge) Execute( @@ -51,10 +53,6 @@ func (b *WhappBridge) Execute( return } - if m.IsInfo() { - return - } - text := whatsapp.TextMessage{ Info: whatsapp.MessageInfo{ RemoteJid: *JID,