Commit 1b942b33 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fixed message state if linphone has crashed while sending it

parent c0f5d97a
......@@ -601,7 +601,11 @@ shared_ptr<EventLog> MainDbPrivate::selectConferenceChatMessageEvent (
chatMessage->setIsSecured(bool(row.get<int>(9)));
ChatMessagePrivate *dChatMessage = chatMessage->getPrivate();
dChatMessage->setState(ChatMessage::State(row.get<int>(7)), true);
ChatMessage::State messageState = (ChatMessage::State) row.get<int>(7);
// This is necessary if linphone has crashed while sending a message. It will set the correct state so the user can resend it.
if (messageState == ChatMessage::State::Idle || messageState == ChatMessage::State::InProgress)
messageState = ChatMessage::State::NotDelivered;
dChatMessage->setState(messageState, true);
dChatMessage->forceFromAddress(IdentityAddress(row.get<string>(3)));
dChatMessage->forceToAddress(IdentityAddress(row.get<string>(4)));
......
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