--- a/external/linphone-sdk/liblinphone/src/db/main-db.cpp 2025-10-10 16:22:37.123386545 +0200 +++ b/external/linphone-sdk/liblinphone/src/db/main-db.cpp 2025-10-10 16:33:48.158692448 +0200 @@ -1869,8 +1869,17 @@ static const string query = "SELECT chat_message_participant.state FROM chat_message_participant WHERE event_id = :eventId AND " "chat_message_participant.participant_sip_address_id = :meAddressId"; + + // soci 4.0 - not compatible with soci 4.1 + // soci::rowset rows = + // (session->prepare << query, soci::use(chatMessage->getStorageId()), soci::use(meAddressId)); + // + // fix: + auto storageId = chatMessage->getStorageId(); + auto addressId = meAddressId; soci::rowset rows = - (session->prepare << query, soci::use(chatMessage->getStorageId()), soci::use(meAddressId)); + (session->prepare << query, soci::use(storageId), soci::use(addressId)); + ChatMessage::State meParticipantState = ChatMessage::State::Idle; for (const auto &row : rows) { meParticipantState = static_cast(row.get(0)); @@ -1893,7 +1902,12 @@ " FROM sip_address, chat_message_participant" " WHERE event_id = :eventId" " AND sip_address.id = chat_message_participant.participant_sip_address_id"; - soci::rowset rows = (session->prepare << query, soci::use(chatMessage->getStorageId())); + // soci 4.0 - not compatible with soci 4.1 + // soci::rowset rows = (session->prepare << query, soci::use(chatMessage->getStorageId())); + // + // fix: + auto storageId2 = chatMessage->getStorageId(); + soci::rowset rows = (session->prepare << query, soci::use(storageId2)); // Use list of participants the client is sure have received the message and not the actual list of participants // being part of the chatroom @@ -5032,11 +5046,22 @@ L_D(); list> chatMessages; auto epoch = d->dbSession.getTimeWithSociIndicator(0); - soci::rowset rows = - getBackend() == MainDb::Backend::Sqlite3 - ? (d->dbSession.getBackendSession()->prepare << query, soci::use(epoch.first), - soci::use(EPHEMERAL_MESSAGE_TASKS_MAX_NB)) - : (d->dbSession.getBackendSession()->prepare << query, soci::use(epoch.first)); + + // soci 4.0 - not compatible with soci 4.1 + // soci::rowset rows = + // getBackend() == MainDb::Backend::Sqlite3 + // ? (d->dbSession.getBackendSession()->prepare << query, soci::use(epoch.first), + // soci::use(EPHEMERAL_MESSAGE_TASKS_MAX_NB)) + // : (d->dbSession.getBackendSession()->prepare << query, soci::use(epoch.first)); + // + // fix: + int maxTasks = EPHEMERAL_MESSAGE_TASKS_MAX_NB; + soci::rowset rows = + getBackend() == MainDb::Backend::Sqlite3 + ? (d->dbSession.getBackendSession()->prepare << query, soci::use(epoch.first), + soci::use(maxTasks)) + : (d->dbSession.getBackendSession()->prepare << query, soci::use(epoch.first)); + for (const auto &row : rows) { const long long &dbChatRoomId = d->dbSession.resolveId(row, (int)row.size() - 1); ConferenceId conferenceId = d->getConferenceIdFromCache(dbChatRoomId); @@ -5816,8 +5841,16 @@ MainDbKeyPrivate *dEventKey = static_cast(dEventLog->dbKey).getPrivate(); const long long &dbEventId = dEventKey->storageId; - soci::rowset rows = (d->dbSession.getBackendSession()->prepare << query, soci::use(dbChatRoomId), - soci::use(dbEventId), soci::use(before + 1), soci::use(after + 1)); + // soci 4.0 - not compatible with soci 4.1 + // soci::rowset rows = (d->dbSession.getBackendSession()->prepare << query, soci::use(dbChatRoomId), + // soci::use(dbEventId), soci::use(before + 1), soci::use(after + 1)); + // + // fix: + auto dbEventId_ = dbEventId; + auto before_ = before + 1; + auto after_ = after + 1; + soci::rowset rows = (d->dbSession.getBackendSession()->prepare << query, soci::use(dbChatRoomId), + soci::use(dbEventId_), soci::use(before_), soci::use(after_)); for (const auto &row : rows) { shared_ptr event = d->selectGenericConferenceEvent(chatRoom, row);