projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b3d1054
)
Limit maximum actor follow score
author
Chocobozzz
<me@florianbigard.com>
Tue, 6 Aug 2019 15:30:09 +0000
(17:30 +0200)
committer
Chocobozzz
<me@florianbigard.com>
Wed, 7 Aug 2019 10:07:58 +0000
(12:07 +0200)
server/models/activitypub/actor-follow.ts
patch
|
blob
|
history
diff --git
a/server/models/activitypub/actor-follow.ts
b/server/models/activitypub/actor-follow.ts
index 99a5fd117db552d8a34a87aff0c1c319e3e78bee..51b09e09be14c039d7fcc712bbf6d81ee660fc88 100644
(file)
--- a/
server/models/activitypub/actor-follow.ts
+++ b/
server/models/activitypub/actor-follow.ts
@@
-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" ' +