plugin_e2ee: encrypt: also search tabs for barejids if not found
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
72ec3cd73b
commit
5d5d6b7ed0
1 changed files with 9 additions and 4 deletions
|
@ -441,10 +441,15 @@ class E2EEPlugin(BasePlugin):
|
||||||
# MUCs). Let the plugin decide what to do with this information.
|
# MUCs). Let the plugin decide what to do with this information.
|
||||||
jids: Optional[List[JID]] = [message['to']]
|
jids: Optional[List[JID]] = [message['to']]
|
||||||
tab = self.core.tabs.by_jid(message['to'])
|
tab = self.core.tabs.by_jid(message['to'])
|
||||||
if tab is None: # When does that ever happen?
|
if tab is None and message['to'].resource:
|
||||||
log.debug('Attempting to encrypt a message to \'%s\' '
|
# Redo the search with the bare JID
|
||||||
'that is not attached to a Tab. ?! Aborting '
|
tab = self.core.tabs.by_jid(message['to'].bare)
|
||||||
'encryption.', message['to'])
|
|
||||||
|
if tab is None: # Possible message sent directly by the e2ee lib?
|
||||||
|
log.debug(
|
||||||
|
'A message we do not have a tab for '
|
||||||
|
'is being sent to \'%s\'. Abort.', message['to'],
|
||||||
|
)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
parent = None
|
parent = None
|
||||||
|
|
Loading…
Reference in a new issue