From d8b9fe08a63f1bd4aebcdbf69a688a7ba45c31c9 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 30 Nov 2010 23:36:57 +0100 Subject: [PATCH] ignore groupchat invitations from contacts that are not in roster if ignore_unknown_contacts is enabled. Fixes #6057 --- src/common/connection_handlers_events.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/connection_handlers_events.py b/src/common/connection_handlers_events.py index 4c2e7a9e8..ea84321ba 100644 --- a/src/common/connection_handlers_events.py +++ b/src/common/connection_handlers_events.py @@ -1007,6 +1007,11 @@ class GcInvitationReceivedEvent(nec.NetworkIncomingEvent): except helpers.InvalidFormat: log.warn('Invalid JID: %s, ignoring it' % item.getAttr('from')) return + jid = gajim.get_jid_without_resource(self.jid_from) + if gajim.config.get_per('accounts', self.conn.name, + 'ignore_unknown_contacts') and not gajim.contacts.get_contacts( + self.conn.name, jid): + return self.reason = item.getTagData('reason') self.password = self.msg_obj.invite_tag.getTagData('password')