Skip to content
Snippets Groups Projects
Commit 8109ee38 authored by Nico's avatar Nico
Browse files

Only add message if it belongs to contact

Before, messages from all chats were added to the current chat.

Also scrolls to bottom now after adding a message async.
parent 127f023d
No related tags found
1 merge request!15Only add message async if it belongs to contact
...@@ -87,7 +87,12 @@ class PrivateChatContainer(Container): ...@@ -87,7 +87,12 @@ class PrivateChatContainer(Container):
self._messages_box.add(message_widget) self._messages_box.add(message_widget)
def _add_message_async(self, message): def _add_message_async(self, message):
GLib.idle_add(self._add_message, message) if message["data"]["contactId"] == self._contact_id:
GLib.idle_add(self._add_message_and_scroll, message["data"])
def _add_message_and_scroll(self, message):
self._add_message(message)
GLib.idle_add(self._scroll_to_bottom)
# pylint: disable=unused-argument # pylint: disable=unused-argument
def _on_message_scroll_draw(self, widget, cairo_context): def _on_message_scroll_draw(self, widget, cairo_context):
......
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