summaryrefslogtreecommitdiff
path: root/plugins/vcard.py
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2019-04-28 01:02:49 +0100
committerMaxime “pep” Buquet <pep@bouah.net>2019-04-28 01:02:49 +0100
commit7a1b2b982f431eb591d348fbb799a4d761a13c65 (patch)
tree4bb79aa2b03b9fd303dffb747e17319bcf0d722f /plugins/vcard.py
parent200f229464d87791f9cc67a03df0259741bf24a6 (diff)
downloadpoezio-7a1b2b982f431eb591d348fbb799a4d761a13c65.tar.gz
poezio-7a1b2b982f431eb591d348fbb799a4d761a13c65.tar.bz2
poezio-7a1b2b982f431eb591d348fbb799a4d761a13c65.tar.xz
poezio-7a1b2b982f431eb591d348fbb799a4d761a13c65.zip
plugins: Update use of tab.name to tab.jid where appropriate
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
Diffstat (limited to 'plugins/vcard.py')
-rw-r--r--plugins/vcard.py10
1 files changed, 6 insertions, 4 deletions
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