From 2b3cde233fec354bf1b1894e926d67ec9ce371b8 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 2 Jul 2021 20:59:25 +0200 Subject: fix: improve typing preliminary to more typing added to slixmpp, fix things in advance --- poezio/core/commands.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'poezio/core/commands.py') diff --git a/poezio/core/commands.py b/poezio/core/commands.py index 48042a29..f6794092 100644 --- a/poezio/core/commands.py +++ b/poezio/core/commands.py @@ -1011,7 +1011,7 @@ class CommandCore: jid = None if args: try: - jid = JID(args[0]).full + jid = JID(args[0]) except InvalidJID: self.core.information('Invalid JID %s' % args, 'Error') return @@ -1027,7 +1027,7 @@ class CommandCore: if isinstance(item, Contact): jid = item.bare_jid elif isinstance(item, Resource): - jid = item.jid + jid = JID(item.jid) chattabs = ( tabs.ConversationTab, @@ -1035,7 +1035,7 @@ class CommandCore: tabs.DynamicConversationTab, ) if isinstance(current_tab, chattabs): - jid = current_tab.jid.bare + jid = JID(current_tab.jid.bare) if jid is None: self.core.information('No specified JID to block', 'Error') @@ -1066,7 +1066,7 @@ class CommandCore: jid = None if args: try: - jid = JID(args[0]).full + jid = JID(args[0]) except InvalidJID: self.core.information('Invalid JID %s' % args, 'Error') return @@ -1082,7 +1082,7 @@ class CommandCore: if isinstance(item, Contact): jid = item.bare_jid elif isinstance(item, Resource): - jid = item.jid + jid = JID(item.jid) chattabs = ( tabs.ConversationTab, @@ -1090,7 +1090,7 @@ class CommandCore: tabs.DynamicConversationTab, ) if isinstance(current_tab, chattabs): - jid = current_tab.jid.bare + jid = JID(current_tab.jid.bare) if jid is not None: asyncio.ensure_future( @@ -1158,6 +1158,7 @@ class CommandCore: else: self.core.information('Room %s destroyed' % room, 'Info') + room: Optional[JID] if not args[0] and isinstance(self.core.tabs.current_tab, tabs.MucTab): room = self.core.tabs.current_tab.general_jid else: -- cgit v1.2.3