Option to lookup call remote party in LDAP using only username instead of full address (telephony context)

This commit is contained in:
Christophe Deschamps 2025-01-10 09:38:28 +01:00
parent 0bc0a44af2
commit 783c0dbfd1
3 changed files with 12 additions and 2 deletions

View file

@ -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);
}

View file

@ -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

View file

@ -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();