Make retry_decrypt_events() work for good
This commit is contained in:
parent
adbe2d88ee
commit
8a99ccd976
|
@ -1179,17 +1179,19 @@ class MatrixClient(nio.AsyncClient):
|
||||||
|
|
||||||
# Add the Event to model
|
# Add the Event to model
|
||||||
|
|
||||||
|
model = self.models[self.user_id, room.room_id, "events"]
|
||||||
|
|
||||||
tx_id = ev.source.get("content", {}).get(
|
tx_id = ev.source.get("content", {}).get(
|
||||||
f"{__app_name__}.transaction_id",
|
f"{__app_name__}.transaction_id",
|
||||||
)
|
)
|
||||||
local_sender = ev.sender in self.backend.clients
|
local_sender = ev.sender in self.backend.clients
|
||||||
|
|
||||||
if local_sender and tx_id:
|
if local_sender and tx_id and tx_id in model:
|
||||||
item.id = f"echo-{tx_id}"
|
item.id = f"echo-{tx_id}"
|
||||||
|
|
||||||
if not local_sender and not await self.event_is_past(ev):
|
if not local_sender and not await self.event_is_past(ev):
|
||||||
AlertRequested()
|
AlertRequested()
|
||||||
|
|
||||||
self.models[self.user_id, room.room_id, "events"][item.id] = item
|
model[item.id] = item
|
||||||
|
|
||||||
await self.set_room_last_event(room.room_id, item)
|
await self.set_room_last_event(room.room_id, item)
|
||||||
|
|
|
@ -82,6 +82,7 @@ class Model(MutableMapping):
|
||||||
setattr(existing, field, getattr(new, field))
|
setattr(existing, field, getattr(new, field))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if self.sync_id:
|
||||||
new.parent_model = self
|
new.parent_model = self
|
||||||
|
|
||||||
self._data[key] = new
|
self._data[key] = new
|
||||||
|
|
|
@ -60,13 +60,13 @@ QtObject {
|
||||||
|
|
||||||
|
|
||||||
function onModelItemInserted(syncId, index, item) {
|
function onModelItemInserted(syncId, index, item) {
|
||||||
print("insert", syncId, index, item)
|
// print("insert", syncId, index, item)
|
||||||
ModelStore.get(syncId).insert(index, item)
|
ModelStore.get(syncId).insert(index, item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function onModelItemFieldChanged(syncId, oldIndex, newIndex, field, value){
|
function onModelItemFieldChanged(syncId, oldIndex, newIndex, field, value){
|
||||||
print("change", syncId, oldIndex, newIndex, field, value)
|
// print("change", syncId, oldIndex, newIndex, field, value)
|
||||||
const model = ModelStore.get(syncId)
|
const model = ModelStore.get(syncId)
|
||||||
model.setProperty(oldIndex, field, value)
|
model.setProperty(oldIndex, field, value)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user