Commit 67dba419 authored by Tijmen de Mes's avatar Tijmen de Mes

Prevent duplicate messages in chat window

parent acb0ac5c
...@@ -687,6 +687,9 @@ class ChatWidget(base_class, ui_class): ...@@ -687,6 +687,9 @@ 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 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