diff --git a/coreapi/bellesip_sal/sal_op_message.c b/coreapi/bellesip_sal/sal_op_message.c index 39e98e65b..6b3147625 100644 --- a/coreapi/bellesip_sal/sal_op_message.c +++ b/coreapi/bellesip_sal/sal_op_message.c @@ -98,8 +98,6 @@ void sal_process_incoming_message(SalOp *op,const belle_sip_request_event_t *eve saliscomposing.from=from; saliscomposing.text=belle_sip_message_get_body(BELLE_SIP_MESSAGE(req)); op->base.root->callbacks.is_composing_received(op,&saliscomposing); - resp = belle_sip_response_create_from_request(req,200); - belle_sip_server_transaction_send_response(server_transaction,resp); belle_sip_object_unref(address); belle_sip_free(from); } else { diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 428368dc4..95d5a3d30 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -1163,13 +1163,14 @@ static void text_received(SalOp *op, const SalMessage *msg){ if (reason == LinphoneReasonNone && is_duplicate_msg(lc, msg->message_id) == FALSE) { reason = linphone_core_message_received(lc, op, msg); } - sal_message_reply(op,linphone_reason_to_sal(reason)); + sal_message_reply(op, linphone_reason_to_sal(reason)); if (!call) sal_op_release(op); } static void is_composing_received(SalOp *op, const SalIsComposing *is_composing) { LinphoneCore *lc = (LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op)); - linphone_core_is_composing_received(lc, op, is_composing); + LinphoneReason reason = linphone_core_is_composing_received(lc, op, is_composing); + sal_message_reply(op, linphone_reason_to_sal(reason)); sal_op_release(op); } diff --git a/coreapi/chat.c b/coreapi/chat.c index 1e6202d49..6bc224dcb 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -702,10 +702,11 @@ static void linphone_chat_room_notify_is_composing(LinphoneChatRoom *cr, const c linphone_xmlparsing_context_destroy(xml_ctx); } -void linphone_core_is_composing_received(LinphoneCore *lc, SalOp *op, const SalIsComposing *is_composing) { +LinphoneReason linphone_core_is_composing_received(LinphoneCore *lc, SalOp *op, const SalIsComposing *is_composing) { LinphoneAddress *addr = linphone_address_new(is_composing->from); LinphoneChatRoom *cr = _linphone_core_get_chat_room(lc, addr); LinphoneImEncryptionEngine *imee = linphone_core_get_im_encryption_engine(lc); + LinphoneReason reason = LinphoneReasonNone; if (cr != NULL) { int retval = -1; @@ -720,10 +721,14 @@ void linphone_core_is_composing_received(LinphoneCore *lc, SalOp *op, const SalI } if (retval <= 0) { linphone_chat_room_notify_is_composing(cr, msg->message); + } else { + reason = linphone_error_code_to_reason(retval); } linphone_chat_message_unref(msg); } linphone_address_destroy(addr); + + return reason; } bool_t linphone_chat_room_is_remote_composing(const LinphoneChatRoom *cr) { diff --git a/coreapi/private.h b/coreapi/private.h index b83415e9d..898677377 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -551,7 +551,7 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore *lc void linphone_proxy_config_write_to_config_file(struct _LpConfig* config,LinphoneProxyConfig *obj, int index); LinphoneReason linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessage *msg); -void linphone_core_is_composing_received(LinphoneCore *lc, SalOp *op, const SalIsComposing *is_composing); +LinphoneReason linphone_core_is_composing_received(LinphoneCore *lc, SalOp *op, const SalIsComposing *is_composing); void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *cr, uint32_t character, LinphoneCall *call); void linphone_call_init_stats(LinphoneCallStats *stats, int type);