diff options
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r-- | server/lib/activitypub/actor.ts | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts index b3fb75421..2e0f3cfc2 100644 --- a/server/lib/activitypub/actor.ts +++ b/server/lib/activitypub/actor.ts | |||
@@ -132,15 +132,13 @@ async function fetchActorTotalItems (url: string) { | |||
132 | activityPub: true | 132 | activityPub: true |
133 | } | 133 | } |
134 | 134 | ||
135 | let requestResult | ||
136 | try { | 135 | try { |
137 | requestResult = await doRequest(options) | 136 | const { body } = await doRequest(options) |
137 | return body.totalItems ? body.totalItems : 0 | ||
138 | } catch (err) { | 138 | } catch (err) { |
139 | logger.warn('Cannot fetch remote actor count %s.', url, err) | 139 | logger.warn('Cannot fetch remote actor count %s.', url, err) |
140 | return undefined | 140 | return 0 |
141 | } | 141 | } |
142 | |||
143 | return requestResult.totalItems ? requestResult.totalItems : 0 | ||
144 | } | 142 | } |
145 | 143 | ||
146 | async function fetchAvatarIfExists (actorJSON: ActivityPubActor) { | 144 | async function fetchAvatarIfExists (actorJSON: ActivityPubActor) { |
@@ -314,7 +312,6 @@ async function refreshActorIfNeeded (actor: ActorModel) { | |||
314 | if (result === undefined) throw new Error('Cannot fetch remote actor in refresh actor.') | 312 | if (result === undefined) throw new Error('Cannot fetch remote actor in refresh actor.') |
315 | 313 | ||
316 | return sequelizeTypescript.transaction(async t => { | 314 | return sequelizeTypescript.transaction(async t => { |
317 | logger.info('coucou', result.actor.toJSON()) | ||
318 | updateInstanceWithAnother(actor, result.actor) | 315 | updateInstanceWithAnother(actor, result.actor) |
319 | 316 | ||
320 | if (result.avatarName !== undefined) { | 317 | if (result.avatarName !== undefined) { |