diff options
Diffstat (limited to 'plugins/qr.py')
-rwxr-xr-x | plugins/qr.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/qr.py b/plugins/qr.py index 25530248..735c3002 100755 --- a/plugins/qr.py +++ b/plugins/qr.py @@ -3,11 +3,13 @@ import io import logging import qrcode -import sys + +from typing import Dict, Callable + +from slixmpp import JID, InvalidJID from poezio import windows from poezio.tabs import Tab -from poezio.common import safeJID from poezio.core.structs import Command from poezio.decorators import command_args_parser from poezio.plugin import BasePlugin @@ -72,7 +74,7 @@ class QrTab(Tab): Tab.__init__(self, core) self.state = 'highlight' self.text = qr - self.name = qr + self._name = qr self.topic_win = windows.Topic() self.topic_win.set_message(qr) self.qr_win = QrWindow(qr) @@ -169,7 +171,11 @@ class Plugin(BasePlugin): def command_invite(self, args): server = self.core.xmpp.boundjid.domain if len(args) > 0: - server = safeJID(args[0]) + try: + server = JID(args[0]) + except InvalidJID: + self.api.information(f'Invalid JID: {args[0]}', 'Error') + return session = { 'next' : self.on_next, 'error': self.core.handler.adhoc_error |