X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Factivitypub%2Factor.ts;h=74241aba9aed7058a2c94e14cb9a763b1419e8ca;hb=a82ddfad0083bd886b97be945050559c53b0cf30;hp=13b73077e8ca6d6e757f09d92ac264fb3f5d97ec;hpb=1ca9f7c3f7afac2af4c4c25b98426731f7e789c6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts index 13b73077e..74241aba9 100644 --- a/server/lib/activitypub/actor.ts +++ b/server/lib/activitypub/actor.ts @@ -163,9 +163,12 @@ async function updateActorInstance (actorInstance: ActorModel, attributes: Activ actorInstance.followingCount = followingCount actorInstance.inboxUrl = attributes.inbox actorInstance.outboxUrl = attributes.outbox - actorInstance.sharedInboxUrl = attributes.endpoints.sharedInbox actorInstance.followersUrl = attributes.followers actorInstance.followingUrl = attributes.following + + if (attributes.endpoints && attributes.endpoints.sharedInbox) { + actorInstance.sharedInboxUrl = attributes.endpoints.sharedInbox + } } type AvatarInfo = { name: string, onDisk: boolean, fileUrl: string } @@ -437,9 +440,12 @@ async function fetchRemoteActor (actorUrl: string): Promise<{ statusCode?: numbe followingCount: followingCount, inboxUrl: actorJSON.inbox, outboxUrl: actorJSON.outbox, - sharedInboxUrl: actorJSON.endpoints.sharedInbox, followersUrl: actorJSON.followers, - followingUrl: actorJSON.following + followingUrl: actorJSON.following, + + sharedInboxUrl: actorJSON.endpoints && actorJSON.endpoints.sharedInbox + ? actorJSON.endpoints.sharedInbox + : null }) const avatarInfo = await getAvatarInfoIfExists(actorJSON)