Commit 7873f0ae authored by Philipp Hörist's avatar Philipp Hörist

[omemo] Fix sending messages to a room fail

We would receive a KeyError for jids we dont have in the roster,
now we skip them and print a warning.

Fixes #173
parent 07a81890
......@@ -308,6 +308,8 @@ class OmemoState:
continue
if jid_to in encrypted_jids: # We already encrypted to this JID
continue
if jid_to not in self.session_ciphers:
continue
for rid, cipher in self.session_ciphers[jid_to].items():
try:
if self.isTrusted(jid_to, rid) == TRUSTED:
......@@ -368,8 +370,12 @@ class OmemoState:
jid_to = self.plugin.groupchat[room][nick]
if jid_to == self.own_jid:
continue
for device in self.device_ids[jid_to]:
devicelist.append((jid_to, device))
try:
for device in self.device_ids[jid_to]:
devicelist.append((jid_to, device))
except KeyError:
log.warning('no device ids found for %s', jid_to)
continue
return devicelist
if jid == self.own_jid:
......
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