aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-12 11:47:45 +0100
committerChocobozzz <me@florianbigard.com>2018-01-12 11:47:45 +0100
commit32b2b43c06621e384c0bd1610ef0bb9f23399be7 (patch)
treec195943354838bcbe3b1993d77aaf0d3200fd19d /server/lib
parent6502c3d43e512e968ad49f5a3bc9abc302471e18 (diff)
downloadPeerTube-32b2b43c06621e384c0bd1610ef0bb9f23399be7.tar.gz
PeerTube-32b2b43c06621e384c0bd1610ef0bb9f23399be7.tar.zst
PeerTube-32b2b43c06621e384c0bd1610ef0bb9f23399be7.zip
Update follower/following counts
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/activitypub/actor.ts1
-rw-r--r--server/lib/activitypub/process/process-follow.ts3
2 files changed, 4 insertions, 0 deletions
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts
index 1e1eab54a..b3fb75421 100644
--- a/server/lib/activitypub/actor.ts
+++ b/server/lib/activitypub/actor.ts
@@ -314,6 +314,7 @@ async function refreshActorIfNeeded (actor: ActorModel) {
314 if (result === undefined) throw new Error('Cannot fetch remote actor in refresh actor.') 314 if (result === undefined) throw new Error('Cannot fetch remote actor in refresh actor.')
315 315
316 return sequelizeTypescript.transaction(async t => { 316 return sequelizeTypescript.transaction(async t => {
317 logger.info('coucou', result.actor.toJSON())
317 updateInstanceWithAnother(actor, result.actor) 318 updateInstanceWithAnother(actor, result.actor)
318 319
319 if (result.avatarName !== undefined) { 320 if (result.avatarName !== undefined) {
diff --git a/server/lib/activitypub/process/process-follow.ts b/server/lib/activitypub/process/process-follow.ts
index 5085c5da9..69f5c51b5 100644
--- a/server/lib/activitypub/process/process-follow.ts
+++ b/server/lib/activitypub/process/process-follow.ts
@@ -51,6 +51,9 @@ async function follow (actor: ActorModel, targetActorURL: string) {
51 transaction: t 51 transaction: t
52 }) 52 })
53 53
54 actorFollow.ActorFollower = actor
55 actorFollow.ActorFollowing = targetActor
56
54 if (actorFollow.state !== 'accepted') { 57 if (actorFollow.state !== 'accepted') {
55 actorFollow.state = 'accepted' 58 actorFollow.state = 'accepted'
56 await actorFollow.save({ transaction: t }) 59 await actorFollow.save({ transaction: t })