summary refs log tree commit diff
path: root/src/Cache.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-06-18 18:36:19 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-06-18 18:36:19 +0300
commit7ecabcd61410783267f1ef4353d65716b84f7f83 (patch)
treea144076be0dc757ae34ef4f08d28473f3fc9591b /src/Cache.cc
parentSave the olm account after we create new one-time keys (diff)
downloadnheko-7ecabcd61410783267f1ef4353d65716b84f7f83.tar.xz
Mark encrypted rooms when processing room state
Diffstat (limited to 'src/Cache.cc')
-rw-r--r--src/Cache.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Cache.cc b/src/Cache.cc

index 397dd05f..ed4194ec 100644 --- a/src/Cache.cc +++ b/src/Cache.cc
@@ -183,14 +183,12 @@ Cache::setup() } void -Cache::setEncryptedRoom(const std::string &room_id) +Cache::setEncryptedRoom(lmdb::txn &txn, const std::string &room_id) { nhlog::db()->info("mark room {} as encrypted", room_id); - auto txn = lmdb::txn::begin(env_); - auto db = lmdb::dbi::open(txn, ENCRYPTED_ROOMS_DB, MDB_CREATE); + auto db = lmdb::dbi::open(txn, ENCRYPTED_ROOMS_DB, MDB_CREATE); lmdb::dbi_put(txn, db, lmdb::val(room_id), lmdb::val("0")); - txn.commit(); } bool