Commit 254ab7ab authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added a method to get the current lime x3dh server url

parent c6026139
......@@ -1573,6 +1573,14 @@ LINPHONE_PUBLIC bool_t linphone_core_lime_x3dh_enabled(const LinphoneCore *lc);
**/
LINPHONE_PUBLIC void linphone_core_set_lime_x3dh_server_url(LinphoneCore *lc, const char *url);
/**
* Get the x3dh server url.
* @param[in] lc LinphoneCore object
* return The x3dh server url
* @ingroup misc
**/
LINPHONE_PUBLIC const char *linphone_core_get_lime_x3dh_server_url(LinphoneCore *lc);
/**
* Tells if LIME X3DH is available
* @param[in] lc LinphoneCore object
......
......@@ -79,6 +79,10 @@ void linphone_core_set_lime_x3dh_server_url(LinphoneCore *lc, const char *url) {
L_GET_CPP_PTR_FROM_C_OBJECT(lc)->setX3dhServerUrl(L_C_TO_STRING(url));
}
const char *linphone_core_get_lime_x3dh_server_url(LinphoneCore *lc) {
return L_STRING_TO_C(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getX3dhServerUrl());
}
//Deprecated
const char *linphone_core_get_linphone_specs (const LinphoneCore *lc) {
return lp_config_get_string(linphone_core_get_config(lc), "sip", "linphone_specs", NULL);
......
......@@ -318,6 +318,12 @@ void Core::setX3dhServerUrl(const std::string &url) {
}
}
std::string Core::getX3dhServerUrl() const {
LinphoneConfig *lpconfig = linphone_core_get_config(getCCore());
string serverUrl = lp_config_get_string(lpconfig, "lime", "lime_server_url", lp_config_get_string(lpconfig, "lime", "x3dh_server_url", ""));
return serverUrl;
}
bool Core::limeX3dhEnabled () const {
#ifdef HAVE_LIME_X3DH
L_D();
......
......@@ -151,6 +151,7 @@ public:
void setEncryptionEngine (EncryptionEngine *imee);
void enableLimeX3dh (bool enable);
void setX3dhServerUrl (const std::string &url);
std::string getX3dhServerUrl () const;
bool limeX3dhEnabled () const;
bool limeX3dhAvailable () const;
......
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