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

Fix state check in the send() method of ChatMessage.

parent 505cceb2
......@@ -1422,8 +1422,10 @@ void ChatMessage::updateState(State state) {
void ChatMessage::send () {
L_D();
if (d->state != State::NotDelivered) {
lWarning() << "Cannot resend chat message in state " << linphone_chat_message_state_to_string((LinphoneChatMessageState)d->state);
// Do not allow sending a message that is already being sent or that has been correctly delivered/displayed
if ((d->state == State::InProgress) || (d->state == State::Delivered) || (d->state == State::FileTransferDone)
|| (d->state == State::DeliveredToUser) || (d->state == State::Displayed)) {
lWarning() << "Cannot send chat message in state " << linphone_chat_message_state_to_string((LinphoneChatMessageState)d->state);
return;
}
......
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