Commit c865794c authored by Erwan Croze's avatar Erwan Croze 👋🏻

Disable message storage on server side

parent 385aeb33
......@@ -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();
......
......@@ -106,12 +106,13 @@ void ChatRoomPrivate::sendMessage (const shared_ptr<ChatMessage> &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<ConferenceChatMessageEvent> event = static_pointer_cast<ConferenceChatMessageEvent>(
q->getCore()->getPrivate()->mainDb->getEventFromKey(dChatMessage->dbKey)
);
if (!event)
event = make_shared<ConferenceChatMessageEvent>(msg->getTime(), msg);
event = make_shared<ConferenceChatMessageEvent>(time(nullptr), msg);
cb(cr, L_GET_C_BACK_PTR(event));
}
......@@ -200,7 +201,7 @@ void ChatRoomPrivate::chatMessageReceived (const shared_ptr<ChatMessage> &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<ConferenceChatMessageEvent> event = make_shared<ConferenceChatMessageEvent>(msg->getTime(), msg);
shared_ptr<ConferenceChatMessageEvent> event = make_shared<ConferenceChatMessageEvent>(time(nullptr), msg);
if (cb) {
cb(cr, L_GET_C_BACK_PTR(event));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment