summaryrefslogtreecommitdiff
path: root/plugins/vcard.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/vcard.py')
-rw-r--r--plugins/vcard.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/vcard.py b/plugins/vcard.py
index 643dd569..e3a776e3 100644
--- a/plugins/vcard.py
+++ b/plugins/vcard.py
@@ -61,7 +61,7 @@ class Plugin(BasePlugin):
help='Send an XMPP vcard request to jid (see XEP-0054).',
short='Send a vcard request.',
completion=self.completion_vcard)
- for _class in (tabs.PrivateTab, tabs.ConversationTab):
+ for _class in (tabs.PrivateTab, tabs.DynamicConversationTab, tabs.StaticConversationTab):
self.api.add_tab_command(
_class,
'vcard',
@@ -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