diff --git a/Linphone/core/call/CallCore.cpp b/Linphone/core/call/CallCore.cpp index 1472cdea223138a588c7fcddd284dd9a7bb618a1..c47d436afdd1d89f084f97ca24905d7249dc8178 100644 --- a/Linphone/core/call/CallCore.cpp +++ b/Linphone/core/call/CallCore.cpp @@ -861,6 +861,7 @@ void CallCore::findRemoteLdapFriend(QSharedPointer<CallCore> me) { }); } }); - mLdapMagicSearchModel->search(mRemoteAddress, (int)LinphoneEnums::MagicSearchSource::LdapServers, - LinphoneEnums::MagicSearchAggregation::Friend, -1); + mLdapMagicSearchModel->search( + SettingsModel::getInstance()->getUsernameOnlyForLdapLookupsInCalls() ? mRemoteUsername : mRemoteAddress, + (int)LinphoneEnums::MagicSearchSource::LdapServers, LinphoneEnums::MagicSearchAggregation::Friend, -1); } diff --git a/Linphone/model/setting/SettingsModel.cpp b/Linphone/model/setting/SettingsModel.cpp index 5cd936b6ee5a7f52bd8a0dfaf607142a78609a26..af71af44e8eb069b86dbb4ed2e03acdbea16d49c 100644 --- a/Linphone/model/setting/SettingsModel.cpp +++ b/Linphone/model/setting/SettingsModel.cpp @@ -685,6 +685,7 @@ void SettingsModel::notifyConfigReady(){ DEFINE_NOTIFY_CONFIG_READY(downloadFolder, DownloadFolder) DEFINE_NOTIFY_CONFIG_READY(shortcutCount, ShortcutCount) DEFINE_NOTIFY_CONFIG_READY(shortcuts, Shortcuts) + DEFINE_NOTIFY_CONFIG_READY(usernameOnlyForLdapLookupsInCalls, UsernameOnlyForLdapLookupsInCalls) } DEFINE_GETSET_CONFIG(SettingsModel, bool, Bool, disableChatFeature, DisableChatFeature, "disable_chat_feature", true) @@ -799,4 +800,11 @@ DEFINE_GETSET_CONFIG(SettingsModel, ShortcutCount, "shortcut_count", 0) +DEFINE_GETSET_CONFIG(SettingsModel, + bool, + Bool, + usernameOnlyForLdapLookupsInCalls, + UsernameOnlyForLdapLookupsInCalls, + "username_only_for_ldap_lookups_in_calls", + false) // clang-format on diff --git a/Linphone/model/setting/SettingsModel.hpp b/Linphone/model/setting/SettingsModel.hpp index 0bfc5ae569dd5c49998cd5b691997494a6a23d65..0866b57efb2c7c9b7770ae3b4a0b5e2ed212d84c 100644 --- a/Linphone/model/setting/SettingsModel.hpp +++ b/Linphone/model/setting/SettingsModel.hpp @@ -170,6 +170,7 @@ public: DECLARE_GETSET(QString, downloadFolder, DownloadFolder) DECLARE_GETSET(int, shortcutCount, ShortcutCount) DECLARE_GETSET(QVariantList, shortcuts, Shortcuts) + DECLARE_GETSET(bool, usernameOnlyForLdapLookupsInCalls, UsernameOnlyForLdapLookupsInCalls) signals: void logsUploadUrlChanged();