From 9055a4aadcf7293067d7341099db80727218b38e Mon Sep 17 00:00:00 2001 From: wurstsalat Date: Thu, 6 Oct 2022 17:23:45 +0200 Subject: [PATCH] [anti_spam] 1.6.7 --- anti_spam/modules/anti_spam.py | 12 ++++++------ anti_spam/plugin-manifest.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/anti_spam/modules/anti_spam.py b/anti_spam/modules/anti_spam.py index 025406b..0c05fb7 100644 --- a/anti_spam/modules/anti_spam.py +++ b/anti_spam/modules/anti_spam.py @@ -38,8 +38,8 @@ zeroconf = False class AntiSpam(BaseModule): - def __init__(self, con: types.Client) -> None: - BaseModule.__init__(self, con, plugin=True) + def __init__(self, client: types.Client) -> None: + BaseModule.__init__(self, client, plugin=True) self.handlers = [ StanzaHandler(name='message', @@ -130,7 +130,7 @@ class AntiSpam(BaseModule): if str(msg_from) in whitelist: return False - roster_item = self._con.get_module('Roster').get_item(msg_from) + roster_item = self._client.get_module('Roster').get_item(msg_from) if is_muc_pm or roster_item is None: assert properties.body @@ -148,7 +148,7 @@ class AntiSpam(BaseModule): def _send_question(self, properties: MessageProperties, jid: JID) -> None: message = 'Anti Spam Question: %s' % self._config['msgtxt_question'] stanza = Message(to=jid, body=message, typ=properties.type.value) - self._con.connection.send_stanza(stanza) + self._client.connection.send_stanza(stanza) self._log.info('Anti spam question sent to %s', jid) def _subscribe_received(self, @@ -158,10 +158,10 @@ class AntiSpam(BaseModule): ) -> None: msg_from = properties.jid block_sub = self._config['block_subscription_requests'] - roster_item = self._con.get_module('Roster').get_item(msg_from) + roster_item = self._client.get_module('Roster').get_item(msg_from) if block_sub and roster_item is None: - self._con.get_module('Presence').unsubscribed(msg_from) + self._client.get_module('Presence').unsubscribed(msg_from) self._log.info('Denied subscription request from %s' % msg_from) raise NodeProcessed diff --git a/anti_spam/plugin-manifest.json b/anti_spam/plugin-manifest.json index df0ff25..3f4f5f7 100644 --- a/anti_spam/plugin-manifest.json +++ b/anti_spam/plugin-manifest.json @@ -18,5 +18,5 @@ "gajim>=1.4.0" ], "short_name": "anti_spam", - "version": "1.6.6" + "version": "1.6.7" } \ No newline at end of file