aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Profile/ProfileManager.php
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2024-09-17 21:41:45 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2024-09-17 22:20:36 +0200
commit26abc86eca7cf6ae95f20e1dc180774d11892aab (patch)
treec646582f842066e92b8cce3ddc593e3bef0a24b7 /lib/private/Profile/ProfileManager.php
parentdc71cb7c3a94eeea69f647f248f3bcbfcecdbe2b (diff)
downloadnextcloud-server-26abc86eca7cf6ae95f20e1dc180774d11892aab.tar.gz
nextcloud-server-26abc86eca7cf6ae95f20e1dc180774d11892aab.zip
feat: add profile pronouns
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib/private/Profile/ProfileManager.php')
-rw-r--r--lib/private/Profile/ProfileManager.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Profile/ProfileManager.php b/lib/private/Profile/ProfileManager.php
index 5e36a9c2f56..b2d5016104b 100644
--- a/lib/private/Profile/ProfileManager.php
+++ b/lib/private/Profile/ProfileManager.php
@@ -66,6 +66,7 @@ class ProfileManager implements IProfileManager {
IAccountManager::PROPERTY_HEADLINE,
IAccountManager::PROPERTY_ORGANISATION,
IAccountManager::PROPERTY_ROLE,
+ IAccountManager::PROPERTY_PRONOUNS,
];
public function __construct(
@@ -222,7 +223,7 @@ class ProfileManager implements IProfileManager {
/**
* Return the profile parameters of the target user that are visible to the visiting user
* in an associative array
- * @return array{userId: string, address?: string|null, biography?: string|null, displayname?: string|null, headline?: string|null, isUserAvatarVisible?: bool, organisation?: string|null, role?: string|null, actions: list<array{id: string, icon: string, title: string, target: ?string}>}
+ * @return array{userId: string, address?: string|null, biography?: string|null, displayname?: string|null, headline?: string|null, isUserAvatarVisible?: bool, organisation?: string|null, pronouns?: non-falsy-string|null, role?: string|null, actions: list<array{id: string, icon: string, title: string, target: ?string}>}
*/
public function getProfileFields(IUser $targetUser, ?IUser $visitingUser): array {
$account = $this->accountManager->getAccount($targetUser);
@@ -241,6 +242,7 @@ class ProfileManager implements IProfileManager {
case IAccountManager::PROPERTY_HEADLINE:
case IAccountManager::PROPERTY_ORGANISATION:
case IAccountManager::PROPERTY_ROLE:
+ case IAccountManager::PROPERTY_PRONOUNS:
$profileParameters[$property] =
$this->isProfileFieldVisible($property, $targetUser, $visitingUser)
// Explicitly set to null when value is empty string
@@ -399,6 +401,10 @@ class ProfileManager implements IProfileManager {
'appId' => self::CORE_APP_ID,
'displayId' => $this->l10nFactory->get('lib')->t('Role'),
],
+ IAccountManager::PROPERTY_PRONOUNS => [
+ 'appId' => self::CORE_APP_ID,
+ 'displayId' => $this->l10nFactory->get('lib')->t('Pronouns'),
+ ],
];
$paramMetadata = array_merge($actionsMetadata, $propertiesMetadata);