fix(MainDb): commit on markChatMessagesAsRead

This commit is contained in:
Ronan Abhamon 2018-02-27 11:10:58 +01:00
parent e3cf0be408
commit 79da08fec1

View file

@ -1867,6 +1867,7 @@ bool MainDb::deleteEvent (const shared_ptr<const EventLog> &eventLog) {
return L_DB_EXCEPTION_HANDLER_C(&mainDb) {
soci::session *session = mainDb.getPrivate()->dbSession.getBackendSession();
*session << "DELETE FROM event WHERE id = :id", soci::use(dEventKey->storageId);
tr.commit();
dEventLog->dbKey = MainDbEventKey();
@ -1875,8 +1876,6 @@ bool MainDb::deleteEvent (const shared_ptr<const EventLog> &eventLog) {
eventLog
)->getChatMessage()->getPrivate()->dbKey = MainDbChatMessageKey();
tr.commit();
return true;
};
}
@ -2075,8 +2074,8 @@ void MainDb::markChatMessagesAsRead (const ChatRoomId &chatRoomId) const {
else {
const long long &dbChatRoomId = d->selectChatRoomId(chatRoomId);
*session << query, soci::use(dbChatRoomId);
tr.commit();
}
tr.commit();
};
}