Commit 615f9d4e authored by Benjamin REIS's avatar Benjamin REIS

Send 200Ok to server if message we can't decrypt to avoid useless...

Send 200Ok to server if message we can't decrypt to avoid useless retransmission + adaptation of tests to this behavior
parent 7549c9dd
......@@ -679,6 +679,11 @@ LinphoneReason linphone_core_message_received(LinphoneCore *lc, SalOp *op, const
} else if(retval > 0) {
// Unable to decrypt message
linphone_core_notify_message_received_unable_decrypt(cr->lc, cr, msg);
reason = linphone_error_code_to_reason(retval);
linphone_chat_message_send_delivery_notification(msg, reason);
// return LinphoneReasonNone to avoid flexisip resending us a message we can't decrypt
reason = LinphoneReasonNone;
goto end;
}
}
}
......
......@@ -1260,7 +1260,7 @@ static void lime_text_message_to_non_lime(bool_t sender_policy_mandatory, bool_t
if (chat_room_size == 1) {
bctbx_list_t *history = linphone_chat_room_get_history(chat_room, 0);
LinphoneChatMessage *sent_msg = (LinphoneChatMessage *)bctbx_list_get_data(history);
BC_ASSERT_EQUAL((int)linphone_chat_message_get_state(sent_msg), (int)LinphoneChatMessageStateNotDelivered, int, "%d");
BC_ASSERT_EQUAL((int)linphone_chat_message_get_state(sent_msg), (int)LinphoneChatMessageStateDelivered, int, "%d");
bctbx_list_free_with_data(history, (bctbx_list_free_func)linphone_chat_message_unref);
}
} else {
......
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