Commit b875d483 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fixed displayed IMDN sent too early in file transfer scenarios

parent af1d954f
......@@ -158,7 +158,6 @@ void ChatMessagePrivate::setState (ChatMessage::State newState) {
linphone_chat_message_cbs_get_msg_state_changed(cbs)(msg, (LinphoneChatMessageState)state);
// 3. Specific case, change to displayed after transfer.
// TODO: Check if there is other file still not downloaded. If not, set state to display
if (state == ChatMessage::State::FileTransferDone && direction == ChatMessage::Direction::Incoming) {
setState(ChatMessage::State::Displayed);
return;
......@@ -166,8 +165,10 @@ void ChatMessagePrivate::setState (ChatMessage::State newState) {
// 4. Send notification and update in database if necessary.
if (state != ChatMessage::State::FileTransferError && state != ChatMessage::State::InProgress) {
if ((state == ChatMessage::State::Displayed) && (direction == ChatMessage::Direction::Incoming))
if ((state == ChatMessage::State::Displayed) && (direction == ChatMessage::Direction::Incoming) && (!hasFileTransferContent())) {
// Wait until all files are downloaded before sending displayed IMDN
static_cast<ChatRoomPrivate *>(q->getChatRoom()->getPrivate())->sendDisplayNotification(q->getSharedFromThis());
}
updateInDb();
}
}
......
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