summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--poezio/tabs/basetabs.py5
-rw-r--r--poezio/tabs/conversationtab.py12
2 files changed, 10 insertions, 7 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py
index a7aa9be9..5dc94ff8 100644
--- a/poezio/tabs/basetabs.py
+++ b/poezio/tabs/basetabs.py
@@ -462,7 +462,7 @@ class ChatTab(Tab):
plugin_keys = {} # type: Dict[str, Callable]
message_type = 'chat'
- def __init__(self, core, jid: JID = None):
+ def __init__(self, core, jid: Optional[JID] = None):
Tab.__init__(self, core)
if jid is not None and not isinstance(jid, JID):
# XXX: Remove logging once we're more or less sure we've switched
@@ -779,8 +779,9 @@ class ChatTab(Tab):
class OneToOneTab(ChatTab):
- def __init__(self, core, jid=''):
+ def __init__(self, core, jid: JID):
ChatTab.__init__(self, core, jid)
+ assert self.name.bare
self.__status = Status("", "")
self.last_remote_message = datetime.now()
diff --git a/poezio/tabs/conversationtab.py b/poezio/tabs/conversationtab.py
index d1ad608c..23529a9b 100644
--- a/poezio/tabs/conversationtab.py
+++ b/poezio/tabs/conversationtab.py
@@ -15,6 +15,8 @@ import curses
import logging
from typing import Dict, Callable
+from slixmpp import JID
+
from poezio.tabs.basetabs import OneToOneTab, Tab
from poezio import common
@@ -42,7 +44,7 @@ class ConversationTab(OneToOneTab):
additional_information = {} # type: Dict[str, Callable[[str], str]]
message_type = 'chat'
- def __init__(self, core, jid):
+ def __init__(self, core, jid: JID):
OneToOneTab.__init__(self, core, jid)
self.nick = None
self.nick_sent = False
@@ -400,10 +402,10 @@ class DynamicConversationTab(ConversationTab):
plugin_commands = {} # type: Dict[str, Command]
plugin_keys = {} # type: Dict[str, Callable]
- def __init__(self, core, jid, resource=None):
+ def __init__(self, core, jid: JID, resource=None):
self.locked_resource = None
- self.name = safeJID(jid).bare
ConversationTab.__init__(self, core, jid)
+ self.name.resource = None
self.info_header = windows.DynamicConversationInfoWin()
self.register_command(
'unlock', self.unlock_command, shortdesc='Deprecated, do nothing.')
@@ -470,8 +472,8 @@ class StaticConversationTab(ConversationTab):
plugin_commands = {} # type: Dict[str, Command]
plugin_keys = {} # type: Dict[str, Callable]
- def __init__(self, core, jid):
- assert (safeJID(jid).resource)
+ def __init__(self, core, jid: JID):
+ assert jid.resource
ConversationTab.__init__(self, core, jid)
self.info_header = windows.ConversationInfoWin()
self.resize()