Commit 8c9164a5 authored by Ghislain MARY's avatar Ghislain MARY

Some more fixes for real time text.

parent 983471e8
......@@ -55,19 +55,11 @@ void RealTimeTextChatRoomPrivate::realtimeTextReceived (uint32_t character, cons
linphone_core_notify_is_composing_received(cCore, L_GET_C_BACK_PTR(q));
if ((character == new_line) || (character == crlf) || (character == lf)) {
/* End of message */
// End of message
lDebug() << "New line received, forge a message with content " << pendingMessage->getPrivate()->getText().c_str();
// TODO: REPAIR ME.
// pendingMessage->setFromAddress(peerAddress);
// pendingMessage->setToAddress(
// Address(
// linphone_call_get_dest_proxy(call)
// ? linphone_address_as_string(linphone_call_get_dest_proxy(call)->identity_address)
// : linphone_core_get_identity(cCore)
// )
// );
pendingMessage->getPrivate()->setState(ChatMessage::State::Delivered);
pendingMessage->getPrivate()->setDirection(ChatMessage::Direction::Incoming);
pendingMessage->getPrivate()->setTime(::ms_time(0));
if (lp_config_get_int(linphone_core_get_config(cCore), "misc", "store_rtt_messages", 1) == 1)
pendingMessage->getPrivate()->storeInDb();
......@@ -80,7 +72,7 @@ void RealTimeTextChatRoomPrivate::realtimeTextReceived (uint32_t character, cons
string text(pendingMessage->getPrivate()->getText());
text += string(value);
pendingMessage->getPrivate()->setText(text);
lInfo() << "Received RTT character: " << value << " (" << character << "), pending text is " << pendingMessage->getPrivate()->getText();
lDebug() << "Received RTT character: " << value << " (" << character << "), pending text is " << pendingMessage->getPrivate()->getText();
delete[] value;
}
}
......
......@@ -1828,6 +1828,8 @@ static void real_time_text_conversation(void) {
}
}
linphone_chat_message_unref(pauline_rtt_message);
linphone_chat_message_unref(marie_rtt_message);
reset_counters(&pauline->stat);
reset_counters(&marie->stat);
pauline_rtt_message = linphone_chat_room_create_message(pauline_chat_room,NULL);
......@@ -1863,6 +1865,8 @@ static void real_time_text_conversation(void) {
BC_ASSERT_STRING_EQUAL(linphone_chat_message_get_text(msg), message2_2);
}
}
linphone_chat_message_unref(pauline_rtt_message);
linphone_chat_message_unref(marie_rtt_message);
}
end_call(marie, pauline);
linphone_call_params_unref(marie_params);
......@@ -1980,6 +1984,7 @@ static void real_time_text_message_accented_chars(void) {
linphone_chat_room_send_chat_message(pauline_chat_room, rtt_message);
BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageReceived, 1));
BC_ASSERT_EQUAL(strcmp(linphone_chat_message_get_text(marie->stat.last_received_chat_message), "ãæçéîøùÿ"), 0, int, "%i");
linphone_chat_message_unref(rtt_message);
}
end_call(marie, pauline);
}
......@@ -2032,6 +2037,7 @@ static void real_time_text_copy_paste(void) {
}
linphone_chat_room_send_chat_message(pauline_chat_room, rtt_message);
BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageReceived, 1));
linphone_chat_message_unref(rtt_message);
}
end_call(marie, pauline);
......
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