@@ -98,20 +98,25 @@ public function resolveReference(string $referenceText): ?IReference {
9898 if ($ user === null ) {
9999 return null ;
100100 }
101+ $ account = $ this ->accountManager ->getAccount ($ user );
102+ $ profileEnabled = $ account ->getProperty (IAccountManager::PROPERTY_PROFILE_ENABLED )->getValue () === '1 ' ;
103+ if (!$ profileEnabled ) {
104+ return null ;
105+ }
101106
102107 $ reference = new Reference ($ referenceText );
103108
104109 $ userDisplayName = $ user ->getDisplayName ();
105110 $ userEmail = $ user ->getEMailAddress ();
106111 $ userAvatarUrl = $ this ->urlGenerator ->linkToRouteAbsolute ('core.avatar.getAvatar ' , ['userId ' => $ userId , 'size ' => '64 ' ]);
107112
108- $ bio = $ this -> accountManager -> getAccount ( $ user ) ->getProperty (IAccountManager::PROPERTY_BIOGRAPHY );
113+ $ bio = $ account ->getProperty (IAccountManager::PROPERTY_BIOGRAPHY );
109114 $ bio = $ bio ->getScope () !== IAccountManager::SCOPE_PRIVATE ? $ bio ->getValue () : null ;
110- $ headline = $ this -> accountManager -> getAccount ( $ user ) ->getProperty (IAccountManager::PROPERTY_HEADLINE );
111- $ location = $ this -> accountManager -> getAccount ( $ user ) ->getProperty (IAccountManager::PROPERTY_ADDRESS );
112- $ website = $ this -> accountManager -> getAccount ( $ user ) ->getProperty (IAccountManager::PROPERTY_WEBSITE );
113- $ organisation = $ this -> accountManager -> getAccount ( $ user ) ->getProperty (IAccountManager::PROPERTY_ORGANISATION );
114- $ role = $ this -> accountManager -> getAccount ( $ user ) ->getProperty (IAccountManager::PROPERTY_ROLE );
115+ $ headline = $ account ->getProperty (IAccountManager::PROPERTY_HEADLINE );
116+ $ location = $ account ->getProperty (IAccountManager::PROPERTY_ADDRESS );
117+ $ website = $ account ->getProperty (IAccountManager::PROPERTY_WEBSITE );
118+ $ organisation = $ account ->getProperty (IAccountManager::PROPERTY_ORGANISATION );
119+ $ role = $ account ->getProperty (IAccountManager::PROPERTY_ROLE );
115120
116121 // for clients who can't render the reference widgets
117122 $ reference ->setTitle ($ userDisplayName );
0 commit comments