diff options
author | Maxime “pep” Buquet <pep@bouah.net> | 2019-04-28 01:02:49 +0100 |
---|---|---|
committer | Maxime “pep” Buquet <pep@bouah.net> | 2019-04-28 01:02:49 +0100 |
commit | 7a1b2b982f431eb591d348fbb799a4d761a13c65 (patch) | |
tree | 4bb79aa2b03b9fd303dffb747e17319bcf0d722f /plugins/ping.py | |
parent | 200f229464d87791f9cc67a03df0259741bf24a6 (diff) | |
download | poezio-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/ping.py')
-rw-r--r-- | plugins/ping.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/ping.py b/plugins/ping.py index 4868ccf9..b9bad4fe 100644 --- a/plugins/ping.py +++ b/plugins/ping.py @@ -22,6 +22,7 @@ Command the current interlocutor. """ +from slixmpp import InvalidJID from poezio.decorators import command_args_parser from poezio.plugin import BasePlugin from poezio.roster import roster @@ -116,7 +117,7 @@ class Plugin(BasePlugin): def command_private_ping(self, arg): if arg: return self.command_ping(arg) - self.command_ping(self.api.current_tab().name) + self.command_ping(self.api.current_tab().jid) @command_args_parser.raw def command_muc_ping(self, arg): @@ -124,10 +125,13 @@ class Plugin(BasePlugin): return user = self.api.current_tab().get_user_by_name(arg) if user: - jid = safeJID(self.api.current_tab().name) + jid = self.api.current_tab().jid jid.resource = user.nick else: - jid = safeJID(arg) + try: + jid = JID(arg) + except InvalidJID: + return self.api.information('Invalid JID: %s' % arg, 'Error') self.command_ping(jid.full) @command_args_parser.raw |