kopia lustrzana https://github.com/nextcloud/social
include the getAccount within the try/catch
rodzic
87252d92bb
commit
2c7cdcb702
|
@ -45,7 +45,6 @@ use OCA\Social\Model\ActivityPub\Person;
|
|||
use OCA\Social\Service\ActivityPub\DocumentService;
|
||||
use OCA\Social\Service\ActivityPub\PersonService;
|
||||
use OCP\Accounts\IAccountManager;
|
||||
use OCP\Accounts\PropertyDoesNotExistException;
|
||||
use OCP\IUserManager;
|
||||
|
||||
|
||||
|
@ -287,14 +286,14 @@ class ActorService {
|
|||
*/
|
||||
private function updateCacheLocalActorName(Person &$actor) {
|
||||
$user = $this->userManager->get($actor->getUserId());
|
||||
$account = $this->accountManager->getAccount($user);
|
||||
|
||||
try {
|
||||
$account = $this->accountManager->getAccount($user);
|
||||
$displayNameProperty = $account->getProperty(IAccountManager::PROPERTY_DISPLAYNAME);
|
||||
if ($displayNameProperty->getScope() === IAccountManager::VISIBILITY_PUBLIC) {
|
||||
$actor->setName($displayNameProperty->getValue());
|
||||
}
|
||||
} catch (PropertyDoesNotExistException $e) {
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue