summary refs log tree commit diff
path: root/src/timeline/EventStore.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-07-25 14:08:13 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-07-25 19:38:27 +0200
commitb294430fe5814d56dcfb32b9db22a8d5f52bfdce (patch)
treea55767910f0425f1dfe0a7379e8fb37df0559153 /src/timeline/EventStore.cpp
parentDon't send url, if we send an encrypted file (diff)
downloadnheko-b294430fe5814d56dcfb32b9db22a8d5f52bfdce.tar.xz
Return to redacted messages instead of just storing the redaction
Diffstat (limited to 'src/timeline/EventStore.cpp')
-rw-r--r--src/timeline/EventStore.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/timeline/EventStore.cpp b/src/timeline/EventStore.cpp

index eb1162cc..704402c8 100644 --- a/src/timeline/EventStore.cpp +++ b/src/timeline/EventStore.cpp
@@ -211,6 +211,7 @@ EventStore::handleSync(const mtx::responses::Timeline &events) if (idx) { events_by_id_.remove( {room_id_, redaction->redacts}); + events_.remove({room_id_, toInternalIdx(*idx)}); emit dataChanged(*idx, *idx); } } @@ -227,8 +228,12 @@ EventStore::handleSync(const mtx::responses::Timeline &events) if (!relates_to.empty()) { auto idx = cache::client()->getTimelineIndex(room_id_, relates_to); - if (idx) + if (idx) { + events_by_id_.remove({room_id_, relates_to}); + decryptedEvents_.remove({room_id_, relates_to}); + events_.remove({room_id_, *idx}); emit dataChanged(toExternalIdx(*idx), toExternalIdx(*idx)); + } } if (auto txn_id = mtx::accessors::transaction_id(event); !txn_id.empty()) {