diff --git a/coreapi/chat.c b/coreapi/chat.c index 4a4ebc7d9..eb0839631 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -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; } } } diff --git a/tester/message_tester.c b/tester/message_tester.c index 702c96a5c..4931dce6c 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -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 {