Commit 8b33f937 authored by Sylvain Berfini's avatar Sylvain Berfini 🐮
Browse files

Revert changes regarding chat_message_sent callback notification (notified...

Revert changes regarding chat_message_sent callback notification (notified before message is really sent but right after chat_message_send() is called) + fixed crash
parent b733a761
......@@ -57,17 +57,10 @@ void ChatRoomPrivate::sendChatMessage (const shared_ptr<ChatMessage> &chatMessag
//if not using cpim, ImdnMessageId = SIP Message call id, so should be computed each time, specially in case of resend.
dChatMessage->setImdnMessageId("");
}
dChatMessage->send();
}
void ChatRoomPrivate::onChatMessageSent(const shared_ptr<ChatMessage> &chatMessage) {
L_Q();
ChatMessagePrivate *dChatMessage = chatMessage->getPrivate();
LinphoneChatRoom *cr = getCChatRoom();
// TODO: server currently don't stock message, remove condition in the future.
if (!linphone_core_conference_server_enabled(q->getCore()->getCCore())) {
bool isResend = chatMessage->getState() == ChatMessage::State::NotDelivered;
if (!isResend && !linphone_core_conference_server_enabled(q->getCore()->getCCore())) {
shared_ptr<ConferenceChatMessageEvent> event = static_pointer_cast<ConferenceChatMessageEvent>(
q->getCore()->getPrivate()->mainDb->getEventFromKey(dChatMessage->dbKey)
);
......@@ -79,6 +72,10 @@ void ChatRoomPrivate::onChatMessageSent(const shared_ptr<ChatMessage> &chatMessa
linphone_core_notify_message_sent(q->getCore()->getCCore(), cr, L_GET_C_BACK_PTR(chatMessage));
}
dChatMessage->send();
}
void ChatRoomPrivate::onChatMessageSent(const shared_ptr<ChatMessage> &chatMessage) {
if (isComposing) isComposing = false;
isComposingHandler->stopIdleTimer();
isComposingHandler->stopRefreshTimer();
......
......@@ -90,10 +90,6 @@ void RealTimeTextChatRoomPrivate::sendChatMessage (const shared_ptr<ChatMessage>
uint32_t newLine = 0x2028;
chatMessage->putCharacter(newLine);
}
}
void RealTimeTextChatRoomPrivate::onChatMessageSent(const shared_ptr<ChatMessage> &chatMessage) {
L_Q();
ChatMessagePrivate *dChatMessage = chatMessage->getPrivate();
shared_ptr<ConferenceChatMessageEvent> event = static_pointer_cast<ConferenceChatMessageEvent>(
......@@ -105,6 +101,10 @@ void RealTimeTextChatRoomPrivate::onChatMessageSent(const shared_ptr<ChatMessage
_linphone_chat_room_notify_chat_message_sent(cr, L_GET_C_BACK_PTR(event));
}
void RealTimeTextChatRoomPrivate::onChatMessageSent(const shared_ptr<ChatMessage> &chatMessage) {
}
// =============================================================================
RealTimeTextChatRoom::RealTimeTextChatRoom (const shared_ptr<Core> &core, const ConferenceId &conferenceId, const std::shared_ptr<ChatRoomParams> &params) :
......
......@@ -36,6 +36,7 @@ int SalRegisterOp::sendRegister (const string &proxy, const string &from, int ex
setTo(from);
setRoute(proxy);
auto request = buildRequest("REGISTER");
if (request == nullptr) return -1;
auto requestUri = belle_sip_request_get_uri(request);
belle_sip_uri_set_user(requestUri, nullptr); // Remove userinfo if there is any
if (mRoot->mUseDates) {
......
......@@ -856,7 +856,6 @@ static void transfer_message_auto_download_aborted(void) {
/* wait for marie to receive pauline's msg */
BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &pauline->stat.number_of_LinphoneMessageSent, 1, 5000));
linphone_chat_message_unref(msg);
BC_ASSERT_FALSE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageReceivedWithFile, 1, 1000));
linphone_core_manager_restart(marie, TRUE);
......@@ -901,6 +900,7 @@ static void transfer_message_auto_download_aborted(void) {
bc_free(send_filepath);
bc_free(receive_filepath);
}
linphone_chat_message_unref(msg);
linphone_core_manager_destroy(pauline);
linphone_core_manager_destroy(marie);
}
......
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