Limit maximum actor follow score

pull/2012/head
Chocobozzz 2019-08-06 17:30:09 +02:00
parent b3d1054e86
commit 327b331889
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 1 additions and 1 deletions

View File

@ -486,7 +486,7 @@ export class ActorFollowModel extends Model<ActorFollowModel> {
const me = await getServerActor()
const serverIdsString = createSafeIn(ActorFollowModel, serverIds)
const query = `UPDATE "actorFollow" SET "score" = "score" + ${value} ` +
const query = `UPDATE "actorFollow" SET "score" = LEAST("score" + ${value}, ${ACTOR_FOLLOW_SCORE.MAX}) ` +
'WHERE id IN (' +
'SELECT "actorFollow"."id" FROM "actorFollow" ' +
'INNER JOIN "actor" ON "actor"."id" = "actorFollow"."targetActorId" ' +