Commit 1860608c authored by Tijmen de Mes's avatar Tijmen de Mes

Update message content if different on duplicate messages in history storage

parent 3c0d9d7b
......@@ -346,7 +346,13 @@ class MessageHistory(object, metaclass=Singleton):
disposition=str(message.disposition),
**optional_fields)
except dberrors.DuplicateEntryError:
pass
try:
dbmessage = Message.selectBy(message_id=message.id)[0]
except IndexError:
pass
else:
if message.content != dbmessage.content:
dbmessage.content = message.content
@run_in_thread('db')
def update(self, id, state):
......
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