nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.24k stars 4.05k forks source link

Option to disable showing system email in avatars' contacts menu #23172

Open PVince81 opened 4 years ago

PVince81 commented 4 years ago

Steps

  1. Setup a NC instance
  2. Create accounts for many external people with email so they can receive an invitation and notifications
  3. Create a Talk conversation with all people
  4. Click on the three dots on a person's avatar in the participant list

Expected result

In the case of external people, we should not see their email address.

Actual result

There's an option to see and click an email address

I suggest to add an option to remove the EmailProvider in config.php or other. A quick hack is to remove https://github.com/nextcloud/server/blob/stable20/lib/private/Contacts/ContactsMenu/ActionProviderStore.php#L88 in config.php

Version

Nextcloud 20

@rullzer @ChristophWurst FYI

PVince81 commented 3 years ago

tagged as good first issue

to access config.php settings from inside ActionProviderStore, inject the IConfig in the constructor and use getSystemValue()

Anth0rx commented 1 year ago

Something like this inside ActionProviderStore.php @PVince81?

private function getServerProviderClasses(): array {
    $showProfile = $this->$config->$getSystemValueBool('contacts_menu_show_profile', true);
    $showLocalTime = $this->$config->$getSystemValueBool('contacts_menu_show_local_time', true);
    $showEMail = $this->$config->$getSystemValueBool('contacts_menu_show_email', false);

    $providerClasses = array();

    if($showProfile) {
        array_push($providerClasses, ProfileProvider::class);
    }

    if($showLocalTime) {
        array_push($providerClasses, LocalTimeProvider::class);
    }

    if($showEMail) {
        array_push($providerClasses, EMailProvider::class);
    }

    return $providerClasses;
}