diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-06 17:30:09 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-07 12:07:58 +0200 |
commit | 327b331889861a031500cb91f698e370f14e3153 (patch) | |
tree | 952bb95e1653ce38ba485973d759e66b4ee70129 /server | |
parent | b3d1054e8602c13122126d7bb3878ffa8363db9e (diff) | |
download | PeerTube-327b331889861a031500cb91f698e370f14e3153.tar.gz PeerTube-327b331889861a031500cb91f698e370f14e3153.tar.zst PeerTube-327b331889861a031500cb91f698e370f14e3153.zip |
Limit maximum actor follow score
Diffstat (limited to 'server')
-rw-r--r-- | server/models/activitypub/actor-follow.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/models/activitypub/actor-follow.ts b/server/models/activitypub/actor-follow.ts index 99a5fd117..51b09e09b 100644 --- a/server/models/activitypub/actor-follow.ts +++ b/server/models/activitypub/actor-follow.ts | |||
@@ -486,7 +486,7 @@ export class ActorFollowModel extends Model<ActorFollowModel> { | |||
486 | const me = await getServerActor() | 486 | const me = await getServerActor() |
487 | const serverIdsString = createSafeIn(ActorFollowModel, serverIds) | 487 | const serverIdsString = createSafeIn(ActorFollowModel, serverIds) |
488 | 488 | ||
489 | const query = `UPDATE "actorFollow" SET "score" = "score" + ${value} ` + | 489 | const query = `UPDATE "actorFollow" SET "score" = LEAST("score" + ${value}, ${ACTOR_FOLLOW_SCORE.MAX}) ` + |
490 | 'WHERE id IN (' + | 490 | 'WHERE id IN (' + |
491 | 'SELECT "actorFollow"."id" FROM "actorFollow" ' + | 491 | 'SELECT "actorFollow"."id" FROM "actorFollow" ' + |
492 | 'INNER JOIN "actor" ON "actor"."id" = "actorFollow"."targetActorId" ' + | 492 | 'INNER JOIN "actor" ON "actor"."id" = "actorFollow"."targetActorId" ' + |