diff options
Diffstat (limited to 'server/models/activitypub')
-rw-r--r-- | server/models/activitypub/actor-follow.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/server/models/activitypub/actor-follow.ts b/server/models/activitypub/actor-follow.ts index b0461b981..3039b90c7 100644 --- a/server/models/activitypub/actor-follow.ts +++ b/server/models/activitypub/actor-follow.ts | |||
@@ -113,6 +113,24 @@ export class ActorFollowModel extends Model<ActorFollowModel> { | |||
113 | ]) | 113 | ]) |
114 | } | 114 | } |
115 | 115 | ||
116 | static removeFollowsOf (actorId: number, t?: Transaction) { | ||
117 | const query = { | ||
118 | where: { | ||
119 | [Op.or]: [ | ||
120 | { | ||
121 | actorId | ||
122 | }, | ||
123 | { | ||
124 | targetActorId: actorId | ||
125 | } | ||
126 | ] | ||
127 | }, | ||
128 | transaction: t | ||
129 | } | ||
130 | |||
131 | return ActorFollowModel.destroy(query) | ||
132 | } | ||
133 | |||
116 | // Remove actor follows with a score of 0 (too many requests where they were unreachable) | 134 | // Remove actor follows with a score of 0 (too many requests where they were unreachable) |
117 | static async removeBadActorFollows () { | 135 | static async removeBadActorFollows () { |
118 | const actorFollows = await ActorFollowModel.listBadActorFollows() | 136 | const actorFollows = await ActorFollowModel.listBadActorFollows() |