Option to control Ldap Friend cache clearing
This commit is contained in:
parent
98cadf8b5d
commit
6833dd10d2
3 changed files with 17 additions and 4 deletions
|
|
@ -96,10 +96,12 @@ void CoreModel::start() {
|
||||||
mCore->setUserAgent(Utils::appStringToCoreString(userAgent), LINPHONESDK_VERSION);
|
mCore->setUserAgent(Utils::appStringToCoreString(userAgent), LINPHONESDK_VERSION);
|
||||||
mCore->start();
|
mCore->start();
|
||||||
setPathAfterStart();
|
setPathAfterStart();
|
||||||
// Remove ldap friends cache list. If not, old stored friends will take priority on merge and will not be updated
|
if (SettingsModel::clearLocalLdapFriendsUponStartup(config)) {
|
||||||
// from new LDAP requests..
|
// Remove ldap friends cache list. If not, old stored friends will take priority on merge and will not be
|
||||||
auto ldapFriendList = mCore->getFriendListByName("ldap_friends");
|
// updated from new LDAP requests..
|
||||||
if (ldapFriendList) mCore->removeFriendList(ldapFriendList);
|
auto ldapFriendList = mCore->getFriendListByName("ldap_friends");
|
||||||
|
if (ldapFriendList) mCore->removeFriendList(ldapFriendList);
|
||||||
|
}
|
||||||
mCore->enableFriendListSubscription(true);
|
mCore->enableFriendListSubscription(true);
|
||||||
// TODO : get this from settings
|
// TODO : get this from settings
|
||||||
auto videoPolicy = mCore->getVideoActivationPolicy()->clone();
|
auto videoPolicy = mCore->getVideoActivationPolicy()->clone();
|
||||||
|
|
|
||||||
|
|
@ -603,6 +603,15 @@ QString SettingsModel::getDeviceName(const std::shared_ptr<linphone::Config> &co
|
||||||
config->getString(UiSection, "device_name", Utils::appStringToCoreString(QSysInfo::machineHostName())));
|
config->getString(UiSection, "device_name", Utils::appStringToCoreString(QSysInfo::machineHostName())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ==============================================================================
|
||||||
|
// Clears the local "ldap_friends" friend list upon startup (Ldap contacts cache)
|
||||||
|
// ==============================================================================
|
||||||
|
|
||||||
|
bool SettingsModel::clearLocalLdapFriendsUponStartup(const shared_ptr<linphone::Config> &config) {
|
||||||
|
mustBeInLinphoneThread(sLog().arg(Q_FUNC_INFO));
|
||||||
|
return config ? config->getBool(UiSection, "clear_local_ldap_friends_upon_startup", false) : false;
|
||||||
|
}
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
// Ui.
|
// Ui.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,8 @@ public:
|
||||||
|
|
||||||
static QString getDeviceName(const std::shared_ptr<linphone::Config> &config);
|
static QString getDeviceName(const std::shared_ptr<linphone::Config> &config);
|
||||||
|
|
||||||
|
static bool clearLocalLdapFriendsUponStartup(const std::shared_ptr<linphone::Config> &config);
|
||||||
|
|
||||||
// UI
|
// UI
|
||||||
DECLARE_GETSET(bool, disableChatFeature, DisableChatFeature)
|
DECLARE_GETSET(bool, disableChatFeature, DisableChatFeature)
|
||||||
DECLARE_GETSET(bool, disableMeetingsFeature, DisableMeetingsFeature)
|
DECLARE_GETSET(bool, disableMeetingsFeature, DisableMeetingsFeature)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue