]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/server/follows.ts
Basic video redundancy implementation
[github/Chocobozzz/PeerTube.git] / server / controllers / api / server / follows.ts
index 23308445f746dd419182d8af7ef216e7f5437185..a4eae6b45b69df0288d733b1cd993050119c81c7 100644 (file)
@@ -96,6 +96,11 @@ async function removeFollow (req: express.Request, res: express.Response, next:
   await sequelizeTypescript.transaction(async t => {
     if (follow.state === 'accepted') await sendUndoFollow(follow, t)
 
+    // Disable redundancy on unfollowed instances
+    const server = follow.ActorFollowing.Server
+    server.redundancyAllowed = false
+    await server.save({ transaction: t })
+
     await follow.destroy({ transaction: t })
   })