From 783c0dbfd1419bce5fece779fa9dd0e197815ee4 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Fri, 10 Jan 2025 09:38:28 +0100 Subject: [PATCH] Option to lookup call remote party in LDAP using only username instead of full address (telephony context) --- Linphone/core/call/CallCore.cpp | 5 +++-- Linphone/model/setting/SettingsModel.cpp | 8 ++++++++ Linphone/model/setting/SettingsModel.hpp | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Linphone/core/call/CallCore.cpp b/Linphone/core/call/CallCore.cpp index 1472cdea2..c47d436af 100644 --- a/Linphone/core/call/CallCore.cpp +++ b/Linphone/core/call/CallCore.cpp @@ -861,6 +861,7 @@ void CallCore::findRemoteLdapFriend(QSharedPointer 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 5cd936b6e..af71af44e 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 0bfc5ae56..0866b57ef 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();