Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Don't follow ourselves

Chocobozzz1ee48d190361
diff --git a/server/controllers/api/server/follows.ts b/server/controllers/api/server/follows.ts
index bb8713e7a0..4a0a44cd39 100644
--- a/server/controllers/api/server/follows.ts
+++ b/server/controllers/api/server/follows.ts
@@ -106,6 +106,10 @@ async function followRetry (req: express.Request, res: express.Response, next: e
}
function follow (fromActor: ActorModel, targetActor: ActorModel) {
+ if (fromActor.id === targetActor.id) {
+ throw new Error('Follower is the same than target actor.')
+ }
+
return sequelizeTypescript.transaction(async t => {
const [ actorFollow ] = await ActorFollowModel.findOrCreate({
where: {