diff --git a/src/Cache.cpp b/src/Cache.cpp index 58eb2630..b2db9edd 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -3182,9 +3182,11 @@ Cache::clearTimeline(const std::string &room_id) break; } - do { - lmdb::cursor_del(msgCursor); - } while (msgCursor.get(indexVal, val, MDB_PREV)); + if (!start) { + do { + lmdb::cursor_del(msgCursor); + } while (msgCursor.get(indexVal, val, MDB_PREV)); + } cursor.close(); msgCursor.close();