From c865794cac09744fa336a5876108b76bafe48749 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Tue, 5 Dec 2017 13:50:15 +0100 Subject: [PATCH] Disable message storage on server side --- src/chat/chat-message/chat-message.cpp | 3 +++ src/chat/chat-room/chat-room.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index 91a5f897e..451f5c78d 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -569,6 +569,9 @@ void ChatMessagePrivate::send () { void ChatMessagePrivate::store() { L_Q(); + // TODO: store message in the future + if (linphone_core_conference_server_enabled(q->getCore()->getCCore())) return; + bool messageToBeStored = false; for (Content *c : contents) { ContentType contentType = c->getContentType(); diff --git a/src/chat/chat-room/chat-room.cpp b/src/chat/chat-room/chat-room.cpp index 516a35aa8..25f7500d2 100644 --- a/src/chat/chat-room/chat-room.cpp +++ b/src/chat/chat-room/chat-room.cpp @@ -106,12 +106,13 @@ void ChatRoomPrivate::sendMessage (const shared_ptr &msg) { LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(cr); LinphoneChatRoomCbsParticipantAddedCb cb = linphone_chat_room_cbs_get_chat_message_sent(cbs); - if (cb) { + // TODO: server currently don't stock message, remove condition in the future + if (cb && !linphone_core_conference_server_enabled(q->getCore()->getCCore())) { shared_ptr event = static_pointer_cast( q->getCore()->getPrivate()->mainDb->getEventFromKey(dChatMessage->dbKey) ); if (!event) - event = make_shared(msg->getTime(), msg); + event = make_shared(time(nullptr), msg); cb(cr, L_GET_C_BACK_PTR(event)); } @@ -200,7 +201,7 @@ void ChatRoomPrivate::chatMessageReceived (const shared_ptr &msg) { LinphoneChatRoom *cr = L_GET_C_BACK_PTR(q); LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(cr); LinphoneChatRoomCbsParticipantAddedCb cb = linphone_chat_room_cbs_get_chat_message_received(cbs); - shared_ptr event = make_shared(msg->getTime(), msg); + shared_ptr event = make_shared(time(nullptr), msg); if (cb) { cb(cr, L_GET_C_BACK_PTR(event)); }