Skip to content
Snippets Groups Projects
Commit 94bd6966 authored by Nico's avatar Nico
Browse files

Final fixes to private chats

parent 08d9511e
No related branches found
No related tags found
1 merge request!89Refactor MainWindowContainer and others into several controllers/views
Pipeline #5348 passed
......@@ -44,8 +44,6 @@ class MainWindowController:
self._private_chat_controller = None
def open_private_chat(self, contact_id):
if self._private_chat_controller is not None:
raise Exception("Private Chat is already open")
private_chat_view = PrivateChatView(self._builder)
self._private_chat_controller = PrivateChatController(
contact_id, private_chat_view, self._sidebar_controller,
......
......@@ -107,10 +107,9 @@ class PrivateChatController:
confirmation_dialog.show_all()
def open_private_chat(self, contact_id):
print(f"Contact id: {contact_id}")
contact_name = self._get_contact_name(contact_id)
self._prepare_chat_view(contact_name)
self._setup_private_chat_widget(contact_id)
self._setup_private_chat_widget(contact_name, contact_id)
self._current_contact_id = contact_id
@staticmethod
......@@ -170,8 +169,8 @@ class PrivateChatController:
for child in children:
child.destroy()
def _setup_private_chat_widget(self, contact_id):
self._private_chat_view.setup_view(contact_id)
def _setup_private_chat_widget(self, contact_name, contact_id):
self._private_chat_view.setup_view(contact_name, contact_id)
self._private_chat_view.load_content()
history_container = self._builder.get_object("history_container")
history_container.add(self._private_chat_view)
......
......@@ -49,7 +49,8 @@ class PrivateChatView(Gtk.Overlay):
widget.set_text("")
GLib.idle_add(self._scroll_to_bottom)
def setup_view(self, contact_id):
def setup_view(self, contact_name, contact_id):
self._contact_name = contact_name
self._contact_id = contact_id
self._add_from_resource(self.CONTAINER_UI)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment