[omemo] Adapt to Gajim changes
This commit is contained in:
@@ -82,8 +82,9 @@ class DeviceManager:
|
|||||||
def get_devices_for_encryption(self, jid):
|
def get_devices_for_encryption(self, jid):
|
||||||
devices_for_encryption = []
|
devices_for_encryption = []
|
||||||
|
|
||||||
# TODO:
|
client = app.get_client(self._account)
|
||||||
if app.contacts.get_groupchat_contact(self._account, jid) is not None:
|
contact = client.get_module('Contacts').get_contact(jid)
|
||||||
|
if contact.is_groupchat:
|
||||||
devices_for_encryption = self._get_devices_for_muc_encryption(jid)
|
devices_for_encryption = self._get_devices_for_muc_encryption(jid)
|
||||||
else:
|
else:
|
||||||
devices_for_encryption = self._get_devices_for_encryption(jid)
|
devices_for_encryption = self._get_devices_for_encryption(jid)
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ from pathlib import Path
|
|||||||
|
|
||||||
from nbxmpp.namespaces import Namespace
|
from nbxmpp.namespaces import Namespace
|
||||||
from nbxmpp.protocol import NodeProcessed
|
from nbxmpp.protocol import NodeProcessed
|
||||||
from nbxmpp.protocol import JID
|
|
||||||
from nbxmpp.errors import StanzaError
|
from nbxmpp.errors import StanzaError
|
||||||
from nbxmpp.const import PresenceType
|
from nbxmpp.const import PresenceType
|
||||||
from nbxmpp.const import Affiliation
|
from nbxmpp.const import Affiliation
|
||||||
@@ -257,16 +256,14 @@ class OMEMO(BaseModule):
|
|||||||
'trust': GajimTrust[trust.name]})
|
'trust': GajimTrust[trust.name]})
|
||||||
|
|
||||||
def _process_muc_message(self, properties):
|
def _process_muc_message(self, properties):
|
||||||
room_jid = properties.jid.bare
|
|
||||||
resource = properties.jid.resource
|
resource = properties.jid.resource
|
||||||
if properties.muc_ofrom is not None:
|
if properties.muc_ofrom is not None:
|
||||||
# History Message from MUC
|
# History Message from MUC
|
||||||
return properties.muc_ofrom.bare
|
return properties.muc_ofrom.bare
|
||||||
|
|
||||||
# TODO:
|
contact = self._con.get_module('Contacts').get_contact(properties.jid)
|
||||||
contact = app.contacts.get_gc_contact(self._account, room_jid, resource)
|
if contact.real_jid is not None:
|
||||||
if contact is not None:
|
return contact.real_jid.bare
|
||||||
return JID.from_string(contact.jid).bare
|
|
||||||
|
|
||||||
self._log.info('Groupchat: Last resort trying to find SID in DB')
|
self._log.info('Groupchat: Last resort trying to find SID in DB')
|
||||||
from_jid = self.backend.storage.getJidFromDevice(properties.omemo.sid)
|
from_jid = self.backend.storage.getJidFromDevice(properties.omemo.sid)
|
||||||
|
|||||||
Reference in New Issue
Block a user