Commit 144790b4 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added linphone_address_remove_param method

parent d8b1d318
......@@ -763,7 +763,9 @@ void linphone_friend_list_synchronize_friends_from_server(LinphoneFriendList *li
LinphoneFriend * linphone_friend_list_find_friend_by_address(const LinphoneFriendList *list, const LinphoneAddress *address) {
LinphoneAddress *clean_addr = linphone_address_clone(address);
LinphoneFriend *lf;
linphone_address_set_uri_param(clean_addr, "gr", NULL); // Remove any gruu param
if (linphone_address_has_param(clean_addr, "gr")) {
linphone_address_remove_uri_param(clean_addr, "gr");
}
lf = linphone_friend_list_find_friend_by_uri(list, linphone_address_as_string_uri_only(clean_addr));
linphone_address_unref(clean_addr);
return lf;
......
......@@ -254,6 +254,13 @@ LINPHONE_PUBLIC void linphone_address_set_uri_param (LinphoneAddress *address, c
LINPHONE_PUBLIC void linphone_address_set_uri_params (LinphoneAddress *address, const char *params);
/**
* Removes the value of a parameter of the URI of the address
* @param[in] address LinphoneAddress object
* @param[in] uri_param_name The name of the parameter
*/
LINPHONE_PUBLIC void linphone_address_remove_uri_param (LinphoneAddress *address, const char *uri_param_name);
/**
* Destroys a LinphoneAddress object (actually calls linphone_address_unref()).
* @deprecated Use linphone_address_unref() instead
......
......@@ -403,4 +403,14 @@ bool Address::setUriParams (const string &uriParams) {
return true;
}
bool Address::removeUriParam(const string &uriParamName) {
L_D();
if (!d->internalAddress)
return false;
sal_address_remove_uri_param(d->internalAddress, L_STRING_TO_C(uriParamName));
return true;
}
LINPHONE_END_NAMESPACE
......@@ -101,6 +101,7 @@ public:
const std::string &getUriParamValue (const std::string &uriParamName) const;
bool setUriParam (const std::string &uriParamName, const std::string &uriParamValue = "");
bool setUriParams (const std::string &uriParams);
bool removeUriParam(const std::string &uriParamName);
private:
L_DECLARE_PRIVATE(Address);
......
......@@ -186,6 +186,10 @@ void linphone_address_set_uri_params (LinphoneAddress *address, const char *para
L_GET_CPP_PTR_FROM_C_OBJECT(address)->setUriParams(L_C_TO_STRING(params));
}
void linphone_address_remove_uri_param (LinphoneAddress *address, const char *uri_param_name) {
L_GET_CPP_PTR_FROM_C_OBJECT(address)->removeUriParam(L_C_TO_STRING(uri_param_name));
}
void linphone_address_destroy (LinphoneAddress *address) {
belle_sip_object_unref(address);
}
......
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