diff --git a/src/chat_control.py b/src/chat_control.py index 77ceca0ffb6b857c62420f28dfad2b825f07424b..635e808d8a114cc20518cb768db501888204a7a6 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -2583,7 +2583,7 @@ class ChatControl(ChatControlBase): if not self.session: fjid = self.contact.get_full_jid() - new_sess = gajim.connections[self.account].make_new_session(fjid) + new_sess = gajim.connections[self.account].make_new_session(fjid, type_=self.type_id) self.set_session(new_sess) self.session.negotiate_e2e(False) diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index c06e6a747353a299ea16eb0c60cbeb9e7950d80b..2ef8342bfae4ad1ff03048654622f74293f89387 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -1350,6 +1350,8 @@ sent a message to.''' return None def make_new_session(self, jid, thread_id=None, type_='chat', cls=None): + '''create and register a new session. thread_id=None to generate one. + type_ should be 'chat' or 'pm'.''' if not cls: cls = gajim.default_session_type