From 084a1f874f8c6a54c03f770230f820172139e873 Mon Sep 17 00:00:00 2001 From: wurstsalat Date: Sun, 24 Oct 2021 23:18:07 +0200 Subject: [PATCH] [omemo] Adapt to Gajim changes --- omemo/modules/omemo.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/omemo/modules/omemo.py b/omemo/modules/omemo.py index ce046b0..71166cb 100644 --- a/omemo/modules/omemo.py +++ b/omemo/modules/omemo.py @@ -340,11 +340,13 @@ class OMEMO(BaseModule): def is_contact_in_roster(self, jid): if jid == self._own_jid: return True - # TODO: - contact = app.contacts.get_first_contact_from_jid(self._account, jid) - if contact is None: + + roster_item = self._con.get_module('Roster').get_item(jid) + if roster_item is None: return False - return contact.sub == 'both' + + contact = self._con.get_module('Contacts').get_contact(jid) + return contact.subscription == 'both' def on_muc_disco_update(self, event): self._check_if_omemo_capable(event.jid)