omemo: prevent traceback when no JID is specified in non-supported tab

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2019-10-13 13:32:11 +02:00
parent c610a76fd9
commit fb637a597b

View file

@ -269,8 +269,15 @@ class E2EEPlugin(BasePlugin):
def _command_show_fingerprints(self, args: List[str]) -> None:
if not args and isinstance(self.api.current_tab(), self.supported_tab_types):
jid = self.api.current_tab().jid
else:
elif args:
jid = args[0]
else:
self.api.information(
'%s_fingerprint: Couldn\'t deduce JID from context' % (
self.encryption_short_name),
'Error',
)
return None
self._show_fingerprints(JID(jid))
@command_args_parser.quoted(2)