mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
Don't delete messages received out of order (fixup the flickering fix)
This commit is contained in:
parent
ec9da9f42a
commit
65bd099372
1 changed files with 1 additions and 11 deletions
|
@ -148,19 +148,9 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObj
|
||||||
connect(this, &TimelineModel::messageSent, this, [this](QString txn_id, QString event_id) {
|
connect(this, &TimelineModel::messageSent, this, [this](QString txn_id, QString event_id) {
|
||||||
pending.removeOne(txn_id);
|
pending.removeOne(txn_id);
|
||||||
|
|
||||||
// we could have received the message via sync
|
|
||||||
if (events.contains(event_id)) {
|
|
||||||
int idx = idToIndex(event_id);
|
|
||||||
if (idx >= 0) {
|
|
||||||
beginRemoveRows(QModelIndex(), idx, idx);
|
|
||||||
eventOrder.erase(eventOrder.begin() + idx);
|
|
||||||
endRemoveRows();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int idx = idToIndex(txn_id);
|
int idx = idToIndex(txn_id);
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
nhlog::ui()->warn("Sent index out of range");
|
// transaction already received via sync
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
eventOrder[idx] = event_id;
|
eventOrder[idx] = event_id;
|
||||||
|
|
Loading…
Reference in a new issue