Commit d4af2b7d authored by Philipp Hörist's avatar Philipp Hörist

[omemo] Fix encryption messages to self

parent 49ffa7a3
......@@ -93,7 +93,7 @@ class DeviceManager:
raise NoDevicesFound
devices_for_encryption += self._get_own_devices_for_encryption()
return devices_for_encryption
return set(devices_for_encryption)
def _get_devices_for_muc_encryption(self, jid):
devices_for_encryption = []
......@@ -103,8 +103,7 @@ class DeviceManager:
def _get_own_devices_for_encryption(self):
devices_for_encryption = []
own_devices = self.get_devices(self._own_jid)
own_devices.discard(self.own_device)
own_devices = self.get_devices(self._own_jid, without_self=True)
for device in own_devices:
if self._storage.isTrusted(self._own_jid, device):
devices_for_encryption.append((self._own_jid, device))
......
......@@ -189,7 +189,9 @@ class OmemoState(DeviceManager):
log.exception('Failed to encrypt')
continue
recipients = set(whisper_messages.keys()) - set([self._own_jid])
recipients = set(whisper_messages.keys())
if jid != self._own_jid:
recipients -= set([self._own_jid])
if not recipients:
log.error('Encrypted keys empty')
return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment