diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 2c7224314..ce420c6c7 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2527,8 +2527,8 @@ void linphone_core_enable_lime(LinphoneCore *lc, LinphoneLimeState val){ LinphoneImEncryptionEngine *imee = linphone_im_encryption_engine_new(); LinphoneImEncryptionEngineCbs *cbs = linphone_im_encryption_engine_get_callbacks(imee); - if(lime_is_available()){ - if (linphone_core_ready(lc)){ + if (lime_is_available()) { + if (linphone_core_ready(lc)) { lp_config_set_int(lc->config,"sip","lime",val); } @@ -7174,6 +7174,10 @@ void linphone_core_add_content_type_support(LinphoneCore *lc, const char *conten lc->sal->add_content_type_support(content_type); } +void linphone_core_remove_content_type_support(LinphoneCore *lc, const char *content_type) { + lc->sal->remove_content_type_support(content_type); +} + #ifdef ENABLE_UPDATE_CHECK static void update_check_process_terminated(LinphoneCore *lc, LinphoneVersionUpdateCheckResult result, const char *version, const char *url) { linphone_core_notify_version_update_check_result_received(lc, result, version, url); diff --git a/include/linphone/core.h b/include/linphone/core.h index b439cda8e..360f230e3 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -4972,6 +4972,15 @@ const char *linphone_core_get_linphone_specs (const LinphoneCore *core); */ void linphone_core_set_linphone_specs (LinphoneCore *core, const char *specs); +/** + * Remove support for the specified content type. + * It is the application responsibility to handle it correctly afterwards. + * @param[in] lc LinphoneCore object + * @param[in] content_type The content type to remove support for + */ +LINPHONE_PUBLIC void linphone_core_remove_content_type_support(LinphoneCore *lc, const char *content_type); + + /** * @addtogroup chatroom * @{ diff --git a/src/sal/sal.cpp b/src/sal/sal.cpp index a25236587..5c3a58385 100644 --- a/src/sal/sal.cpp +++ b/src/sal/sal.cpp @@ -670,6 +670,14 @@ void Sal::add_content_type_support(const char *content_type) { } } +void Sal::remove_content_type_support(const char *content_type) { + if (content_type != NULL) { + if (bctbx_list_find(this->supported_content_types, content_type)) { + this->supported_content_types = bctbx_list_remove(this->supported_content_types, (char *)content_type); + } + } +} + void Sal::use_rport(bool_t use_rports) { belle_sip_provider_enable_rport(this->prov,use_rports); ms_message("Sal use rport [%s]", use_rports ? "enabled" : "disabled"); diff --git a/src/sal/sal.h b/src/sal/sal.h index 3e48bc481..0bfd2afec 100644 --- a/src/sal/sal.h +++ b/src/sal/sal.h @@ -146,6 +146,7 @@ public: bool_t content_encoding_available(const char *content_encoding) {return (bool_t)belle_sip_stack_content_encoding_available(this->stack, content_encoding);} bool_t is_content_type_supported(const char *content_type) const; void add_content_type_support(const char *content_type); + void remove_content_type_support(const char *content_type); void set_default_sdp_handling(SalOpSDPHandling sdp_handling_method);