Commit e9190cac authored by Tijmen de Mes's avatar Tijmen de Mes

Fixed adding messages when id is missing

parent ec364b61
...@@ -687,9 +687,10 @@ class ChatWidget(base_class, ui_class): ...@@ -687,9 +687,10 @@ class ChatWidget(base_class, ui_class):
return IconManager().get('avatar') or self.default_user_icon return IconManager().get('avatar') or self.default_user_icon
def add_message(self, message): def add_message(self, message):
exists = self.chat_element.findFirst(f'#text-{message.id}') if hasattr(message, 'id'):
if not exists.isNull(): exists = self.chat_element.findFirst(f'#text-{message.id}')
return if not exists.isNull():
return
insertion_point = self.chat_element.findFirst('#insert') insertion_point = self.chat_element.findFirst('#insert')
if message.is_related_to(self.last_message): if message.is_related_to(self.last_message):
message.consecutive = True message.consecutive = True
......
Markdown is supported
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