From 5709b5b756b68212082dd00ed572ed9a28da2c7e Mon Sep 17 00:00:00 2001 From: miruka Date: Sat, 7 Mar 2020 12:35:12 -0400 Subject: [PATCH] Fix local echoed message replaced only for one acc --- src/backend/matrix_client.py | 5 ++++- src/gui/PythonBridge/Privates/EventHandlers.qml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index 46adb019..3ce2a79d 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -10,6 +10,7 @@ import platform import re import traceback from contextlib import suppress +from copy import copy from datetime import datetime from functools import partial from pathlib import Path @@ -520,7 +521,7 @@ class MatrixClient(nio.AsyncClient): for user_id in self.models["accounts"]: if user_id in self.models[self.user_id, room_id, "members"]: key = f"echo-{transaction_id}" - self.models[user_id, room_id, "events"][key] = event + self.models[user_id, room_id, "events"][key] = copy(event) await self.set_room_last_event(room_id, event) @@ -1033,6 +1034,7 @@ class MatrixClient(nio.AsyncClient): fields["inline_content"] = HTML.filter(content, inline=True) # Create Event ModelItem + item = Event( id = ev.event_id, event_id = ev.event_id, @@ -1050,6 +1052,7 @@ class MatrixClient(nio.AsyncClient): ) # Add the Event to model + tx_id = ev.source.get("content", {}).get( f"{__app_name__}.transaction_id", ) diff --git a/src/gui/PythonBridge/Privates/EventHandlers.qml b/src/gui/PythonBridge/Privates/EventHandlers.qml index 1f934eee..3bc041a1 100644 --- a/src/gui/PythonBridge/Privates/EventHandlers.qml +++ b/src/gui/PythonBridge/Privates/EventHandlers.qml @@ -83,6 +83,7 @@ QtObject { function onModelItemFieldChanged(syncId, oldIndex, newIndex, field, value){ + // print("change", syncId, oldIndex, newIndex, field, value) const model = ModelStore.get(syncId) model.setProperty(oldIndex, field, value)