From 26abc86eca7cf6ae95f20e1dc180774d11892aab Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Tue, 17 Sep 2024 21:41:45 +0200 Subject: feat: add profile pronouns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- lib/private/Profile/ProfileManager.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/private/Profile/ProfileManager.php') 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} + * @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} */ 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); -- cgit v1.2.3