kopia lustrzana https://github.com/nextcloud/social
Merge pull request #216 from nextcloud/bugfix/noid/getaccount-catched
include the getAccount within the try/catchpull/178/head^2
commit
d0e6a8b220
|
@ -45,7 +45,6 @@ use OCA\Social\Model\ActivityPub\Person;
|
||||||
use OCA\Social\Service\ActivityPub\DocumentService;
|
use OCA\Social\Service\ActivityPub\DocumentService;
|
||||||
use OCA\Social\Service\ActivityPub\PersonService;
|
use OCA\Social\Service\ActivityPub\PersonService;
|
||||||
use OCP\Accounts\IAccountManager;
|
use OCP\Accounts\IAccountManager;
|
||||||
use OCP\Accounts\PropertyDoesNotExistException;
|
|
||||||
use OCP\IUserManager;
|
use OCP\IUserManager;
|
||||||
|
|
||||||
|
|
||||||
|
@ -287,14 +286,17 @@ class ActorService {
|
||||||
*/
|
*/
|
||||||
private function updateCacheLocalActorName(Person &$actor) {
|
private function updateCacheLocalActorName(Person &$actor) {
|
||||||
$user = $this->userManager->get($actor->getUserId());
|
$user = $this->userManager->get($actor->getUserId());
|
||||||
$account = $this->accountManager->getAccount($user);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
$account = $this->accountManager->getAccount($user);
|
||||||
$displayNameProperty = $account->getProperty(IAccountManager::PROPERTY_DISPLAYNAME);
|
$displayNameProperty = $account->getProperty(IAccountManager::PROPERTY_DISPLAYNAME);
|
||||||
if ($displayNameProperty->getScope() === IAccountManager::VISIBILITY_PUBLIC) {
|
if ($displayNameProperty->getScope() === IAccountManager::VISIBILITY_PUBLIC) {
|
||||||
$actor->setName($displayNameProperty->getValue());
|
$actor->setName($displayNameProperty->getValue());
|
||||||
}
|
}
|
||||||
} catch (PropertyDoesNotExistException $e) {
|
} catch (Exception $e) {
|
||||||
|
$this->miscService->log(
|
||||||
|
'Issue while trying to updateCacheLocalActorName: ' . $e->getMessage(), 1
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue