Source

Target

Showing with 171 additions and 76 deletions
......@@ -186,18 +186,11 @@ void ChatRoomPrivate::sendDeliveryNotification (const shared_ptr<ChatMessage> &c
}
}
void ChatRoomPrivate::sendDeliveryNotifications () {
L_Q();
LinphoneImNotifPolicy *policy = linphone_core_get_im_notif_policy(q->getCore()->getCCore());
if (linphone_im_notif_policy_get_send_imdn_delivered(policy)) {
auto chatMessages = q->getCore()->getPrivate()->mainDb->findChatMessagesToBeNotifiedAsDelivered(q->getConferenceId());
for (const auto &chatMessage : chatMessages) {
ChatMessagePrivate *dChatMessage = chatMessage->getPrivate();
if (dChatMessage->getPositiveDeliveryNotificationRequired()) {
dChatMessage->setPositiveDeliveryNotificationRequired(false);
imdnHandler->notifyDelivery(chatMessage);
}
}
void ChatRoomPrivate::sendDeliveryNotifications (const std::shared_ptr<ChatMessage> &chatMessage) {
ChatMessagePrivate *dChatMessage = chatMessage->getPrivate();
if (dChatMessage->getPositiveDeliveryNotificationRequired()) {
dChatMessage->setPositiveDeliveryNotificationRequired(false);
imdnHandler->notifyDelivery(chatMessage);
}
}
......@@ -471,6 +464,10 @@ shared_ptr<ChatMessage> ChatRoom::getLastChatMessageInHistory () const {
return getCore()->getPrivate()->mainDb->getLastChatMessage(getConferenceId());
}
bool ChatRoom::isEmpty () const {
return getCore()->getPrivate()->mainDb->getLastChatMessage(getConferenceId()) == nullptr;
}
int ChatRoom::getChatMessageCount () const {
return getCore()->getPrivate()->mainDb->getChatMessageCount(getConferenceId());
}
......
......@@ -61,7 +61,7 @@ public:
void deleteHistory () override;
std::shared_ptr<ChatMessage> getLastChatMessageInHistory () const override;
bool isEmpty () const override;
int getChatMessageCount () const override;
int getUnreadChatMessageCount () const override;
......
......@@ -65,8 +65,8 @@ public:
chatRoom->getPrivate()->removeTransientChatMessage(message);
}
inline void sendDeliveryNotifications () override {
chatRoom->getPrivate()->sendDeliveryNotifications();
inline void sendDeliveryNotifications (const std::shared_ptr<ChatMessage> &chatMessage) override {
chatRoom->getPrivate()->sendDeliveryNotifications(chatMessage);
}
inline void notifyChatMessageReceived (const std::shared_ptr<ChatMessage> &chatMessage) override {
......
......@@ -140,6 +140,11 @@ shared_ptr<ChatMessage> ProxyChatRoom::getLastChatMessageInHistory () const {
return d->chatRoom->getLastChatMessageInHistory();
}
bool ProxyChatRoom::isEmpty () const {
L_D();
return d->chatRoom->isEmpty();
}
int ProxyChatRoom::getChatMessageCount () const {
L_D();
return d->chatRoom->getChatMessageCount();
......
......@@ -56,7 +56,7 @@ public:
void deleteHistory () override;
std::shared_ptr<ChatMessage> getLastChatMessageInHistory () const override;
bool isEmpty () const override;
int getChatMessageCount () const override;
int getUnreadChatMessageCount () const override;
......
......@@ -207,7 +207,7 @@ void ServerGroupChatRoomPrivate::requestDeletion(){
for (auto participant : q->getParticipants()){
unSubscribeRegistrationForParticipant(participant->getAddress());
}
if (registrationSubscriptions.size() > 0){
if (!registrationSubscriptions.empty()){
lError() << q << " still " << registrationSubscriptions.size() << " registration subscriptions pending while deletion is requested.";
}
chatRoomListener->onChatRoomDeleteRequested(q->getSharedFromThis());
......
......@@ -154,7 +154,7 @@ string Cpim::Message::asString () const {
L_D();
string output;
if (d->messageHeaders.size() > 0) {
if (!d->messageHeaders.empty()) {
for (const auto &entry : d->messageHeaders) {
auto list = entry.second;
for (const auto &messageHeader : *list) {
......
......@@ -294,8 +294,6 @@ void CorePrivate::insertChatRoom (const shared_ptr<AbstractChatRoom> &chatRoom)
if (it == chatRoomsById.end()) {
// Remove chat room from workaround cache.
noCreatedClientGroupChatRooms.erase(chatRoom.get());
chatRooms.push_back(chatRoom);
chatRoomsById[conferenceId] = chatRoom;
}
}
......@@ -306,7 +304,6 @@ void CorePrivate::insertChatRoomWithDb (const shared_ptr<AbstractChatRoom> &chat
}
void CorePrivate::loadChatRooms () {
chatRooms.clear();
chatRoomsById.clear();
if (remoteListEventHandler)
remoteListEventHandler->clearHandlers();
......@@ -314,7 +311,18 @@ void CorePrivate::loadChatRooms () {
if (!mainDb->isInitialized()) return;
for (auto &chatRoom : mainDb->getChatRooms()) {
insertChatRoom(chatRoom);
chatRoom->getPrivate()->sendDeliveryNotifications();
}
sendDeliveryNotifications();
}
void CorePrivate::sendDeliveryNotifications () {
L_Q();
LinphoneImNotifPolicy *policy = linphone_core_get_im_notif_policy(q->getCCore());
if (linphone_im_notif_policy_get_send_imdn_delivered(policy)) {
auto chatMessages = mainDb->findChatMessagesToBeNotifiedAsDelivered();
for (const auto &chatMessage : chatMessages) {
chatMessage->getChatRoom()->getPrivate()->sendDeliveryNotifications(chatMessage);
}
}
}
......@@ -323,11 +331,9 @@ void CorePrivate::replaceChatRoom (const shared_ptr<AbstractChatRoom> &replacedC
const ConferenceId &newConferenceId = newChatRoom->getConferenceId();
if (replacedChatRoom->getCapabilities() & ChatRoom::Capabilities::Proxy) {
chatRooms.remove(newChatRoom);
chatRoomsById.erase(replacedConferenceId);
chatRoomsById[newConferenceId] = replacedChatRoom;
} else {
chatRooms.remove(replacedChatRoom);
chatRoomsById.erase(replacedConferenceId);
chatRoomsById[newConferenceId] = newChatRoom;
}
......@@ -335,20 +341,26 @@ void CorePrivate::replaceChatRoom (const shared_ptr<AbstractChatRoom> &replacedC
// -----------------------------------------------------------------------------
const list<shared_ptr<AbstractChatRoom>> &Core::getChatRooms () const {
list<shared_ptr<AbstractChatRoom>> Core::getChatRooms () const {
L_D();
return d->chatRooms;
list<shared_ptr<AbstractChatRoom>> rooms;
for (auto it = d->chatRoomsById.begin(); it != d->chatRoomsById.end(); it++) {
const auto &chatRoom = it->second;
rooms.push_front(chatRoom);
}
return rooms;
}
shared_ptr<AbstractChatRoom> Core::findChatRoom (const ConferenceId &conferenceId) const {
shared_ptr<AbstractChatRoom> Core::findChatRoom (const ConferenceId &conferenceId, bool logIfNotFound) const {
L_D();
auto it = d->chatRoomsById.find(conferenceId);
if (it != d->chatRoomsById.cend())
return it->second;
lInfo() << "Unable to find chat room in RAM: " << conferenceId << ".";
if (logIfNotFound)
lInfo() << "Unable to find chat room in RAM: " << conferenceId << ".";
return nullptr;
}
......@@ -356,12 +368,12 @@ list<shared_ptr<AbstractChatRoom>> Core::findChatRooms (const IdentityAddress &p
L_D();
list<shared_ptr<AbstractChatRoom>> output;
copy_if(
d->chatRooms.begin(), d->chatRooms.end(),
back_inserter(output), [&peerAddress](const shared_ptr<AbstractChatRoom> &chatRoom) {
return chatRoom->getPeerAddress() == peerAddress;
for (auto it = d->chatRoomsById.begin(); it != d->chatRoomsById.end(); it++) {
const auto &chatRoom = it->second;
if (chatRoom->getPeerAddress() == peerAddress) {
output.push_front(chatRoom);
}
);
}
return output;
}
......@@ -373,7 +385,8 @@ shared_ptr<AbstractChatRoom> Core::findOneToOneChatRoom (
bool encrypted
) const {
L_D();
for (const auto &chatRoom : d->chatRooms) {
for (auto it = d->chatRoomsById.begin(); it != d->chatRoomsById.end(); it++) {
const auto &chatRoom = it->second;
const IdentityAddress &curLocalAddress = chatRoom->getLocalAddress();
ChatRoom::CapabilitiesMask capabilities = chatRoom->getCapabilities();
......@@ -480,13 +493,9 @@ void Core::deleteChatRoom (const shared_ptr<const AbstractChatRoom> &chatRoom) {
const ConferenceId &conferenceId = chatRoom->getConferenceId();
auto chatRoomsByIdIt = d->chatRoomsById.find(conferenceId);
if (chatRoomsByIdIt != d->chatRoomsById.end()) {
auto chatRoomsIt = find(d->chatRooms, chatRoom);
L_ASSERT(chatRoomsIt != d->chatRooms.end());
d->chatRooms.erase(chatRoomsIt);
d->chatRoomsById.erase(chatRoomsByIdIt);
if (d->mainDb->isInitialized()) d->mainDb->deleteChatRoom(conferenceId);
} else
L_ASSERT(find(d->chatRooms, chatRoom) == d->chatRooms.end());
}
}
LINPHONE_END_NAMESPACE
......@@ -74,6 +74,7 @@ public:
void setPlaybackGainDb (AudioStream *stream, float gain);
void loadChatRooms ();
void sendDeliveryNotifications ();
void insertChatRoom (const std::shared_ptr<AbstractChatRoom> &chatRoom);
void insertChatRoomWithDb (const std::shared_ptr<AbstractChatRoom> &chatRoom, unsigned int notifyId = 0);
std::shared_ptr<AbstractChatRoom> createBasicChatRoom (const ConferenceId &conferenceId, AbstractChatRoom::CapabilitiesMask capabilities, const std::shared_ptr<ChatRoomParams> &params);
......@@ -129,8 +130,6 @@ private:
std::list<std::shared_ptr<Call>> calls;
std::shared_ptr<Call> currentCall;
std::list<std::shared_ptr<AbstractChatRoom>> chatRooms;
std::unordered_map<ConferenceId, std::shared_ptr<AbstractChatRoom>> chatRoomsById;
std::unique_ptr<EncryptionEngine> imee;
......
......@@ -98,7 +98,6 @@ void CorePrivate::uninit () {
ms_usleep(10000);
}
chatRooms.clear();
chatRoomsById.clear();
noCreatedClientGroupChatRooms.clear();
listeners.clear();
......@@ -430,6 +429,27 @@ bool Core::isFriendListSubscriptionEnabled () const {
// Misc.
// -----------------------------------------------------------------------------
void Core::pushNotificationReceived () const {
LinphoneCore *lc = getCCore();
const bctbx_list_t *proxies = linphone_core_get_proxy_config_list(lc);
bctbx_list_t *it = (bctbx_list_t *)proxies;
lInfo() << "Push notification received";
while (it) {
LinphoneProxyConfig *proxy = (LinphoneProxyConfig *) bctbx_list_get_data(it);
LinphoneRegistrationState state = linphone_proxy_config_get_state(proxy);
if (state == LinphoneRegistrationFailed) {
lInfo() << "Proxy config [" << proxy << "] is in failed state, refreshing REGISTER";
if (linphone_proxy_config_register_enabled(proxy) && linphone_proxy_config_get_expires(proxy) > 0) {
linphone_proxy_config_refresh_register(proxy);
}
} else if (state == LinphoneRegistrationOk) {
// TODO: send a keep-alive to ensure the socket isn't broken
}
it = bctbx_list_next(it);
}
}
int Core::getUnreadChatMessageCount () const {
L_D();
return d->mainDb->getUnreadChatMessageCount();
......@@ -438,9 +458,11 @@ int Core::getUnreadChatMessageCount () const {
int Core::getUnreadChatMessageCount (const IdentityAddress &localAddress) const {
L_D();
int count = 0;
for (const auto &chatRoom : d->chatRooms)
for (auto it = d->chatRoomsById.begin(); it != d->chatRoomsById.end(); it++) {
const auto &chatRoom = it->second;
if (chatRoom->getLocalAddress() == localAddress)
count += chatRoom->getUnreadChatMessageCount();
}
return count;
}
......@@ -458,7 +480,8 @@ int Core::getUnreadChatMessageCountFromActiveLocals () const {
localAddresses.insert(*L_GET_CPP_PTR_FROM_C_OBJECT(static_cast<LinphoneProxyConfig *>(it->data)->identity_address));
int count = 0;
for (const auto &chatRoom : d->chatRooms) {
for (auto roomIt = d->chatRoomsById.begin(); roomIt != d->chatRoomsById.end(); roomIt++) {
const auto &chatRoom = roomIt->second;
auto it = localAddresses.find(chatRoom->getLocalAddress());
if (it != localAddresses.end())
count += chatRoom->getUnreadChatMessageCount();
......
......@@ -105,9 +105,9 @@ public:
// ChatRoom.
// ---------------------------------------------------------------------------
const std::list<std::shared_ptr<AbstractChatRoom>> &getChatRooms () const;
std::list<std::shared_ptr<AbstractChatRoom>> getChatRooms () const;
std::shared_ptr<AbstractChatRoom> findChatRoom (const ConferenceId &conferenceId) const;
std::shared_ptr<AbstractChatRoom> findChatRoom (const ConferenceId &conferenceId, bool logIfNotFound = true) const;
std::list<std::shared_ptr<AbstractChatRoom>> findChatRooms (const IdentityAddress &peerAddress) const;
std::shared_ptr<AbstractChatRoom> findOneToOneChatRoom (
......@@ -177,6 +177,7 @@ public:
// Misc.
// ---------------------------------------------------------------------------
void pushNotificationReceived () const;
int getUnreadChatMessageCount () const;
int getUnreadChatMessageCount (const IdentityAddress &localAddress) const;
int getUnreadChatMessageCountFromActiveLocals () const;
......
......@@ -122,6 +122,12 @@ IosPlatformHelpers::IosPlatformHelpers (std::shared_ptr<LinphonePrivate::Core> c
else
ms_error("IosPlatformHelpers did not find cpim grammar resource directory...");
string identityPath = getResourceDirPath(Framework, "identity_grammar");
if (!identityPath.empty())
belr::GrammarLoader::get().addPath(identityPath);
else
ms_error("IosPlatformHelpers did not find identity grammar resource directory...");
#ifdef VCARD_ENABLED
string vcardPath = getResourceDirPath("org.linphone.belcard", "vcard_grammar");
if (!vcardPath.empty())
......
......@@ -36,13 +36,13 @@ class SmartTransaction {
public:
SmartTransaction (soci::session *session, const char *name) :
mSession(session), mName(name), mIsCommitted(false) {
lInfo() << "Start transaction " << this << " in MainDb::" << mName << ".";
lDebug() << "Start transaction " << this << " in MainDb::" << mName << ".";
mSession->begin();
}
~SmartTransaction () {
if (!mIsCommitted) {
lInfo() << "Rollback transaction " << this << " in MainDb::" << mName << ".";
lDebug() << "Rollback transaction " << this << " in MainDb::" << mName << ".";
mSession->rollback();
}
}
......@@ -53,7 +53,7 @@ public:
return;
}
lInfo() << "Commit transaction " << this << " in MainDb::" << mName << ".";
lDebug() << "Commit transaction " << this << " in MainDb::" << mName << ".";
mIsCommitted = true;
mSession->commit();
}
......
......@@ -39,6 +39,7 @@ class MainDbPrivate : public AbstractDbPrivate {
public:
mutable std::unordered_map<long long, std::weak_ptr<EventLog>> storageIdToEvent;
mutable std::unordered_map<long long, std::weak_ptr<ChatMessage>> storageIdToChatMessage;
mutable std::unordered_map<long long, ConferenceId> storageIdToConferenceId;
private:
// ---------------------------------------------------------------------------
......@@ -67,6 +68,7 @@ private:
long long selectSipAddressId (const std::string &sipAddress) const;
long long selectChatRoomId (long long peerSipAddressId, long long localSipAddressId) const;
long long selectChatRoomId (const ConferenceId &conferenceId) const;
ConferenceId selectConferenceId (const long long chatRoomId) const;
long long selectChatRoomParticipantId (long long chatRoomId, long long participantSipAddressId) const;
long long selectOneToOneChatRoomId (long long sipAddressIdA, long long sipAddressIdB, bool encrypted) const;
......@@ -79,7 +81,7 @@ private:
// ---------------------------------------------------------------------------
long long getConferenceEventIdFromRow (const soci::row &row) const {
return dbSession.resolveId(row, -1);
return dbSession.resolveId(row, 0);
}
time_t getConferenceEventCreationTimeFromRow (const soci::row &row) const {
......@@ -169,9 +171,11 @@ private:
void cache (const std::shared_ptr<EventLog> &eventLog, long long storageId) const;
void cache (const std::shared_ptr<ChatMessage> &chatMessage, long long storageId) const;
void cache (const ConferenceId &conferenceId, long long storageId) const;
std::shared_ptr<EventLog> getEventFromCache (long long storageId) const;
std::shared_ptr<ChatMessage> getChatMessageFromCache (long long storageId) const;
ConferenceId getConferenceIdFromCache(long long storageId) const;
void invalidConferenceEventsFromQuery (const std::string &query, long long chatRoomId);
......
......@@ -468,7 +468,32 @@ long long MainDbPrivate::selectChatRoomId (const ConferenceId &conferenceId) con
if (localSipAddressId < 0)
return -1;
return selectChatRoomId(peerSipAddressId, localSipAddressId);
long long id = selectChatRoomId(peerSipAddressId, localSipAddressId);
if (id != -1) {
cache(conferenceId, id);
}
return id;
}
ConferenceId MainDbPrivate::selectConferenceId (const long long chatRoomId) const {
string peerSipAddress;
string localSipAddress;
string query = "SELECT peer_sip_address_id, local_sip_address_id FROM chat_room WHERE id = :1";
soci::session *session = dbSession.getBackendSession();
*session << query, soci::use(chatRoomId), soci::into(peerSipAddress), soci::into(localSipAddress);
ConferenceId conferenceId = ConferenceId(
IdentityAddress(peerSipAddress),
IdentityAddress(localSipAddress)
);
if (conferenceId.isValid()) {
cache(conferenceId, chatRoomId);
}
return conferenceId;
}
long long MainDbPrivate::selectChatRoomParticipantId (long long chatRoomId, long long participantSipAddressId) const {
......@@ -1064,6 +1089,15 @@ shared_ptr<ChatMessage> MainDbPrivate::getChatMessageFromCache (long long storag
return chatMessage;
}
ConferenceId MainDbPrivate::getConferenceIdFromCache(long long storageId) const {
auto it = storageIdToConferenceId.find(storageId);
if (it == storageIdToConferenceId.cend())
return ConferenceId();
ConferenceId conferenceId = it->second;
return conferenceId;
}
void MainDbPrivate::cache (const shared_ptr<EventLog> &eventLog, long long storageId) const {
L_Q();
......@@ -1084,6 +1118,11 @@ void MainDbPrivate::cache (const shared_ptr<ChatMessage> &chatMessage, long long
L_ASSERT(dChatMessage->dbKey.isValid());
}
void MainDbPrivate::cache (const ConferenceId &conferenceId, long long storageId) const {
L_ASSERT(conferenceId.isValid());
storageIdToConferenceId[storageId] = conferenceId;
}
void MainDbPrivate::invalidConferenceEventsFromQuery (const string &query, long long chatRoomId) {
soci::rowset<soci::row> rows = (dbSession.getBackendSession()->prepare << query, soci::use(chatRoomId));
for (const auto &row : rows) {
......@@ -2302,11 +2341,14 @@ list<shared_ptr<ChatMessage>> MainDb::findChatMessages (
};
}
list<shared_ptr<ChatMessage>> MainDb::findChatMessagesToBeNotifiedAsDelivered (
const ConferenceId &conferenceId
) const {
static const string query = Statements::get(Statements::SelectConferenceEvents) +
string(" AND direction = :direction AND delivery_notification_required <> 0");
list<shared_ptr<ChatMessage>> MainDb::findChatMessagesToBeNotifiedAsDelivered () const {
static const string query = "SELECT conference_event_view.id AS event_id, type, creation_time, from_sip_address.value, to_sip_address.value, time, imdn_message_id, state, direction, is_secured, notify_id, device_sip_address.value, participant_sip_address.value, subject, delivery_notification_required, display_notification_required, security_alert, faulty_device, marked_as_read, chat_room_id"
" FROM conference_event_view"
" LEFT JOIN sip_address AS from_sip_address ON from_sip_address.id = from_sip_address_id"
" LEFT JOIN sip_address AS to_sip_address ON to_sip_address.id = to_sip_address_id"
" LEFT JOIN sip_address AS device_sip_address ON device_sip_address.id = device_sip_address_id"
" LEFT JOIN sip_address AS participant_sip_address ON participant_sip_address.id = participant_sip_address_id"
" WHERE conference_event_view.id IN (SELECT event_id FROM conference_chat_message_event WHERE direction = :direction AND delivery_notification_required <> 0)";
/*
DurationLogger durationLogger(
......@@ -2318,21 +2360,28 @@ list<shared_ptr<ChatMessage>> MainDb::findChatMessagesToBeNotifiedAsDelivered (
return L_DB_TRANSACTION {
L_D();
shared_ptr<AbstractChatRoom> chatRoom = d->findChatRoom(conferenceId);
list<shared_ptr<ChatMessage>> chatMessages;
if (!chatRoom)
return chatMessages;
const long long &dbChatRoomId = d->selectChatRoomId(conferenceId);
const int &direction = int(ChatMessage::Direction::Incoming);
soci::rowset<soci::row> rows = (
d->dbSession.getBackendSession()->prepare << query, soci::use(dbChatRoomId), soci::use(direction)
d->dbSession.getBackendSession()->prepare << query, soci::use(direction)
);
for (const auto &row : rows) {
shared_ptr<EventLog> event = d->selectGenericConferenceEvent(chatRoom, row);
if (event) {
L_ASSERT(event->getType() == EventLog::Type::ConferenceChatMessage);
chatMessages.push_back(static_pointer_cast<ConferenceChatMessageEvent>(event)->getChatMessage());
const long long &dbChatRoomId = d->dbSession.resolveId(row, 19);
ConferenceId conferenceId = d->getConferenceIdFromCache(dbChatRoomId);
if (!conferenceId.isValid()) {
conferenceId = d->selectConferenceId(dbChatRoomId);
}
if (conferenceId.isValid()) {
shared_ptr<AbstractChatRoom> chatRoom = d->findChatRoom(conferenceId);
if (chatRoom) {
shared_ptr<EventLog> event = d->selectGenericConferenceEvent(chatRoom, row);
if (event) {
L_ASSERT(event->getType() == EventLog::Type::ConferenceChatMessage);
chatMessages.push_back(static_pointer_cast<ConferenceChatMessageEvent>(event)->getChatMessage());
}
}
}
}
......@@ -2579,12 +2628,16 @@ list<shared_ptr<AbstractChatRoom>> MainDb::getChatRooms () const {
IdentityAddress(row.get<string>(1)),
IdentityAddress(row.get<string>(2))
);
shared_ptr<AbstractChatRoom> chatRoom = core->findChatRoom(conferenceId);
shared_ptr<AbstractChatRoom> chatRoom = core->findChatRoom(conferenceId, false);
if (chatRoom) {
chatRooms.push_back(chatRoom);
continue;
}
const long long &dbChatRoomId = d->dbSession.resolveId(row, 0);
d->cache(conferenceId, dbChatRoomId);
time_t creationTime = d->dbSession.getTime(row, 3);
time_t lastUpdateTime = d->dbSession.getTime(row, 4);
int capabilities = row.get<int>(5);
......@@ -2600,7 +2653,6 @@ list<shared_ptr<AbstractChatRoom>> MainDb::getChatRooms () const {
} else if (capabilities & ChatRoom::CapabilitiesMask(ChatRoom::Capabilities::Conference)) {
list<shared_ptr<Participant>> participants;
const long long &dbChatRoomId = d->dbSession.resolveId(row, 0);
static const string query = "SELECT chat_room_participant.id, sip_address.value, is_admin"
" FROM sip_address, chat_room, chat_room_participant"
" WHERE chat_room.id = :chatRoomId"
......@@ -2689,7 +2741,7 @@ list<shared_ptr<AbstractChatRoom>> MainDb::getChatRooms () const {
dChatRoom->setCreationTime(creationTime);
dChatRoom->setLastUpdateTime(lastUpdateTime);
lInfo() << "Found chat room in DB: (peer=" <<
lDebug() << "Found chat room in DB: (peer=" <<
conferenceId.getPeerAddress().asString() << ", local=" << conferenceId.getLocalAddress().asString() << ").";
chatRooms.push_back(chatRoom);
......
......@@ -126,9 +126,7 @@ public:
const std::string &imdnMessageId
) const;
std::list<std::shared_ptr<ChatMessage>> findChatMessagesToBeNotifiedAsDelivered (
const ConferenceId &conferenceId
) const;
std::list<std::shared_ptr<ChatMessage>> findChatMessagesToBeNotifiedAsDelivered () const;
// ---------------------------------------------------------------------------
// Conference events.
......
......@@ -245,9 +245,9 @@ long long DbSession::resolveId (const soci::row &row, int col) const {
switch (d->backend) {
case DbSessionPrivate::Backend::Mysql:
return static_cast<long long>(row.get<unsigned long long>(0));
return static_cast<long long>(row.get<unsigned long long>((std::size_t)col));
case DbSessionPrivate::Backend::Sqlite3:
return static_cast<long long>(row.get<int>(0));
return static_cast<long long>(row.get<int>((std::size_t)col));
case DbSessionPrivate::Backend::None:
return 0;
}
......
......@@ -516,7 +516,7 @@ bool MagicSearch::checkDomain (const LinphoneFriend *lFriend, const LinphoneAddr
}
void MagicSearch::addResultsToResultsList (std::list<SearchResult> &results, std::list<SearchResult> &srL) const {
if (results.size() > 0) {
if (!results.empty()) {
srL.splice(srL.end(), results);
}
}
......
......@@ -72,7 +72,7 @@ set(CERTIFICATE_CLIENT_FILES
certificates/client/cert2.pem
certificates/client/key2.pem
certificates/client/cert3.pem
certificates/client/key3.pem
certificates/client/key3.pem
certificates/client/cert2-signed-by-other-ca.pem
)
......@@ -82,6 +82,7 @@ set(DB_FILES
db/friends.db
db/linphone.db
db/messages.db
db/chatrooms.db
)
set(RC_FILES
......
File added