diff options
Diffstat (limited to 'server/lib/activitypub/actor.ts')
-rw-r--r-- | server/lib/activitypub/actor.ts | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts index 25cd40905..e0cb986bd 100644 --- a/server/lib/activitypub/actor.ts +++ b/server/lib/activitypub/actor.ts | |||
@@ -33,7 +33,7 @@ function setAsyncActorKeys (actor: ActorModel) { | |||
33 | return actor.save() | 33 | return actor.save() |
34 | }) | 34 | }) |
35 | .catch(err => { | 35 | .catch(err => { |
36 | logger.error('Cannot set public/private keys of actor %d.', actor.uuid, { err }) | 36 | logger.error('Cannot set public/private keys of actor %d.', actor.url, { err }) |
37 | return actor | 37 | return actor |
38 | }) | 38 | }) |
39 | } | 39 | } |
@@ -128,18 +128,17 @@ async function updateActorInstance (actorInstance: ActorModel, attributes: Activ | |||
128 | const followersCount = await fetchActorTotalItems(attributes.followers) | 128 | const followersCount = await fetchActorTotalItems(attributes.followers) |
129 | const followingCount = await fetchActorTotalItems(attributes.following) | 129 | const followingCount = await fetchActorTotalItems(attributes.following) |
130 | 130 | ||
131 | actorInstance.set('type', attributes.type) | 131 | actorInstance.type = attributes.type |
132 | actorInstance.set('uuid', attributes.uuid) | 132 | actorInstance.preferredUsername = attributes.preferredUsername |
133 | actorInstance.set('preferredUsername', attributes.preferredUsername) | 133 | actorInstance.url = attributes.id |
134 | actorInstance.set('url', attributes.id) | 134 | actorInstance.publicKey = attributes.publicKey.publicKeyPem |
135 | actorInstance.set('publicKey', attributes.publicKey.publicKeyPem) | 135 | actorInstance.followersCount = followersCount |
136 | actorInstance.set('followersCount', followersCount) | 136 | actorInstance.followingCount = followingCount |
137 | actorInstance.set('followingCount', followingCount) | 137 | actorInstance.inboxUrl = attributes.inbox |
138 | actorInstance.set('inboxUrl', attributes.inbox) | 138 | actorInstance.outboxUrl = attributes.outbox |
139 | actorInstance.set('outboxUrl', attributes.outbox) | 139 | actorInstance.sharedInboxUrl = attributes.endpoints.sharedInbox |
140 | actorInstance.set('sharedInboxUrl', attributes.endpoints.sharedInbox) | 140 | actorInstance.followersUrl = attributes.followers |
141 | actorInstance.set('followersUrl', attributes.followers) | 141 | actorInstance.followingUrl = attributes.following |
142 | actorInstance.set('followingUrl', attributes.following) | ||
143 | } | 142 | } |
144 | 143 | ||
145 | async function updateActorAvatarInstance (actorInstance: ActorModel, avatarName: string, t: Transaction) { | 144 | async function updateActorAvatarInstance (actorInstance: ActorModel, avatarName: string, t: Transaction) { |
@@ -388,7 +387,6 @@ async function fetchRemoteActor (actorUrl: string): Promise<{ statusCode?: numbe | |||
388 | 387 | ||
389 | const actor = new ActorModel({ | 388 | const actor = new ActorModel({ |
390 | type: actorJSON.type, | 389 | type: actorJSON.type, |
391 | uuid: actorJSON.uuid, | ||
392 | preferredUsername: actorJSON.preferredUsername, | 390 | preferredUsername: actorJSON.preferredUsername, |
393 | url: actorJSON.id, | 391 | url: actorJSON.id, |
394 | publicKey: actorJSON.publicKey.publicKeyPem, | 392 | publicKey: actorJSON.publicKey.publicKeyPem, |