From 71f5e47cff1443dffa8bf95cb2e56beefe6d85e0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 22 Feb 2018 13:18:34 +0100 Subject: [PATCH] feat(MainDb): remove order by on events fetch --- src/db/main-db.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index 2714a1f72..2b4009291 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -2251,11 +2251,9 @@ list> MainDb::getHistoryRange ( return events; } - string query = Statements::get(Statements::SelectConferenceEvents, Backend::Sqlite3); - query += buildSqlEventFilter({ + string query = Statements::get(Statements::SelectConferenceEvents, Backend::Sqlite3) + buildSqlEventFilter({ ConferenceCallFilter, ConferenceChatMessageFilter, ConferenceInfoFilter, ConferenceInfoNoDeviceFilter }, mask, "AND"); - query += " ORDER BY creation_time DESC"; if (end > 0) query += " LIMIT " + Utils::toString(end - begin); @@ -2788,7 +2786,10 @@ void MainDb::enableChatRoomMigration (const ChatRoomId &chatRoomId, bool enable) }; } -void MainDb::updateChatRoomParticipantDevice (const shared_ptr &chatRoom, const shared_ptr &device) { +void MainDb::updateChatRoomParticipantDevice ( + const shared_ptr &chatRoom, + const shared_ptr &device +) { L_SAFE_TRANSACTION { L_D(); @@ -2799,10 +2800,10 @@ void MainDb::updateChatRoomParticipantDevice (const shared_ptr const long long &participantSipAddressId = d->selectSipAddressId(device->getParticipant()->getAddress().asString()); const long long &participantId = d->selectChatRoomParticipantId(dbChatRoomId, participantSipAddressId); const long long &participantSipDeviceAddressId = d->selectSipAddressId(device->getAddress().asString()); - unsigned int stateInt = static_cast(device->getState()); + unsigned int state = static_cast(device->getState()); *session << "UPDATE chat_room_participant_device SET state = :state" " WHERE chat_room_participant_id = :participantId AND participant_device_sip_address_id = :participantSipDeviceAddressId", - soci::use(stateInt), soci::use(participantId), soci::use(participantSipDeviceAddressId); + soci::use(state), soci::use(participantId), soci::use(participantSipDeviceAddressId); tr.commit(); };