Skip to content

Commit abcbbed

Browse files
authored
fix(sharing): move lookup label flag to core app config
Signed-off-by: nicolas.varlot@ac-versailles.fr Signed-off-by: Nicolas Varlot <nicolas.varlot@ac-versailles.fr>
1 parent a29083c commit abcbbed

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

lib/private/Collaboration/Collaborators/LookupPlugin.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b
3838
$isGlobalScaleEnabled = $this->config->getSystemValueBool('gs.enabled', false);
3939
$isLookupServerEnabled = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'no') === 'yes';
4040
$hasInternetConnection = $this->config->getSystemValueBool('has_internet_connection', true);
41-
// System config flag: shareapi_lookup_label_show_email
41+
// App config flag (core app config): shareapi_lookup_label_show_email
4242
// Controls whether email addresses from federated lookup results are shown in share dialog labels.
43-
// Defaults to false to avoid exposing email addresses unnecessarily. Enabling this may reveal
43+
// Defaults to 'no' to avoid exposing email addresses unnecessarily. Enabling this may reveal
4444
// users' email addresses to people using the share dialog and should therefore be considered carefully.
45-
$showEmailInLabel = $this->config->getSystemValueBool('shareapi_lookup_label_show_email', false);
45+
$showEmailInLabel = $this->config->getAppValue('core', 'shareapi_lookup_label_show_email', 'no') === 'yes';
4646

4747
// If case of Global Scale we always search the lookup server
4848
// TODO: Reconsider using the lookup server for non-global scale
@@ -86,10 +86,12 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b
8686
$email = $lookup['email']['value'] ?? '';
8787

8888
if ($showEmailInLabel && $email !== '') {
89-
$label = empty($name) ? $email : $name . ' (' . $email . ')';
89+
$id = $email;
9090
} else {
91-
$label = empty($name) ? $lookup['federationId'] : $name . ' (' . $lookup['federationId'] . ')';
91+
$id = $lookup['federationId'];
9292
}
93+
$label = $name === '' ? $id : $name . ' (' . $id . ')';
94+
9395
$result[] = [
9496
'label' => $label,
9597
'value' => [

0 commit comments

Comments
 (0)