Commit 4defa977 authored by Nico's avatar Nico
Browse files

Don't expect messages to always have text

Some messages are notices that don't carry any text (responses to forum invitations for example).

Traceback (most recent call last):
  File "/usr/share/briar-gtk/briar_gtk/containers/", line 101, in _add_message
    message_widget = PrivateMessageWidget(self._contact_name, message)
  File "/usr/share/briar-gtk/briar_gtk/widgets/", line 18, in __init__
    self._setup_view(contact_name, message)
  File "/usr/share/briar-gtk/briar_gtk/widgets/", line 34, in _setup_view
KeyError: 'text'

Fixes #56.
parent 56378e12
Pipeline #4644 passed with stage
in 4 minutes and 16 seconds
......@@ -98,9 +98,15 @@ class PrivateChatContainer(Container):
def _add_message(self, message):
if self._is_not_message(message):
message_widget = PrivateMessageWidget(self._contact_name, message)
def _is_not_message(message):
return "text" not in message
def _add_message_async(self, message):
if message["data"]["contactId"] == self._contact_id:
GLib.idle_add(self._add_message_and_scroll, message["data"])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment