From 7a1b2b982f431eb591d348fbb799a4d761a13c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sun, 28 Apr 2019 01:02:49 +0100 Subject: plugins: Update use of tab.name to tab.jid where appropriate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- plugins/vcard.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugins/vcard.py') diff --git a/plugins/vcard.py b/plugins/vcard.py index 643dd569..09dcda28 100644 --- a/plugins/vcard.py +++ b/plugins/vcard.py @@ -273,7 +273,7 @@ class Plugin(BasePlugin): if arg: self.command_vcard(arg) return - self.command_vcard(self.api.current_tab().name) + self.command_vcard(self.api.current_tab().jid.full) @command_args_parser.raw def command_muc_vcard(self, arg): @@ -282,10 +282,12 @@ class Plugin(BasePlugin): return user = self.api.current_tab().get_user_by_name(arg) if user: - # No need to use safeJID here, we already know the JID is valid. - jid = JID(self.api.current_tab().name + '/' + user.nick) + jid = self.api.current_tab().jid.bare + '/' + user.nick else: - jid = safeJID(arg) + try: + jid = safeJID(arg) + except InvalidJID: + return self.api.information('Invalid JID: %s' % arg, 'Error') self._get_vcard(jid) @command_args_parser.raw -- cgit v1.2.3