diff --git a/src/Cache.cpp b/src/Cache.cpp index 58eb2630a047ef98e6212cfbf9f6acd7bbc0cfd1..b2db9edd184fea530c0e7df11f2d7ea69f8d5945 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();