[omemo] Port python-omemo changes from master

This commit is contained in:
Philipp Hörist
2017-01-24 11:29:58 +01:00
parent d38fe92d0f
commit a58ff4f6e8
8 changed files with 241 additions and 86 deletions

View File

@@ -29,6 +29,14 @@ class SQLDatabase():
self.dbConn = dbConn
self.createDb()
self.migrateDb()
c = self.dbConn.cursor()
c.execute("PRAGMA synchronous=NORMAL;")
c.execute("PRAGMA journal_mode;")
mode = c.fetchone()[0]
# WAL is a persistent DB mode, dont override it if user has set it
if mode != 'wal':
c.execute("PRAGMA journal_mode=MEMORY;")
self.dbConn.commit()
def createDb(self):
if user_version(self.dbConn) == 0: