aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/actor.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-10-23 11:33:53 +0200
committerChocobozzz <me@florianbigard.com>2019-10-23 11:33:53 +0200
commit47581df0737ebcc058a5863143c752f9112a4424 (patch)
tree3b64e3fc49de4bea41d8fd852201ba3abb6b4994 /server/lib/activitypub/actor.ts
parenta0e6d267598839c8a5508a65876ce0e07d1b3d74 (diff)
downloadPeerTube-47581df0737ebcc058a5863143c752f9112a4424.tar.gz
PeerTube-47581df0737ebcc058a5863143c752f9112a4424.tar.zst
PeerTube-47581df0737ebcc058a5863143c752f9112a4424.zip
Fix federation with some actors
That don't have a shared inbox, or a URL
Diffstat (limited to 'server/lib/activitypub/actor.ts')
-rw-r--r--server/lib/activitypub/actor.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts
index 13b73077e..cad9af5e0 100644
--- a/server/lib/activitypub/actor.ts
+++ b/server/lib/activitypub/actor.ts
@@ -163,9 +163,12 @@ async function updateActorInstance (actorInstance: ActorModel, attributes: Activ
163 actorInstance.followingCount = followingCount 163 actorInstance.followingCount = followingCount
164 actorInstance.inboxUrl = attributes.inbox 164 actorInstance.inboxUrl = attributes.inbox
165 actorInstance.outboxUrl = attributes.outbox 165 actorInstance.outboxUrl = attributes.outbox
166 actorInstance.sharedInboxUrl = attributes.endpoints.sharedInbox
167 actorInstance.followersUrl = attributes.followers 166 actorInstance.followersUrl = attributes.followers
168 actorInstance.followingUrl = attributes.following 167 actorInstance.followingUrl = attributes.following
168
169 if (attributes.endpoints && attributes.endpoints.sharedInbox) {
170 actorInstance.sharedInboxUrl = attributes.endpoints.sharedInbox
171 }
169} 172}
170 173
171type AvatarInfo = { name: string, onDisk: boolean, fileUrl: string } 174type AvatarInfo = { name: string, onDisk: boolean, fileUrl: string }
@@ -437,9 +440,12 @@ async function fetchRemoteActor (actorUrl: string): Promise<{ statusCode?: numbe
437 followingCount: followingCount, 440 followingCount: followingCount,
438 inboxUrl: actorJSON.inbox, 441 inboxUrl: actorJSON.inbox,
439 outboxUrl: actorJSON.outbox, 442 outboxUrl: actorJSON.outbox,
440 sharedInboxUrl: actorJSON.endpoints.sharedInbox,
441 followersUrl: actorJSON.followers, 443 followersUrl: actorJSON.followers,
442 followingUrl: actorJSON.following 444 followingUrl: actorJSON.following,
445
446 sharedInboxUrl: actorJSON.endpoints && actorJSON.endpoints.sharedInbox
447 ? actorJSON.endpoints.sharedInbox
448 : null,
443 }) 449 })
444 450
445 const avatarInfo = await getAvatarInfoIfExists(actorJSON) 451 const avatarInfo = await getAvatarInfoIfExists(actorJSON)