From 030177d246834fdba89be9bbaeac497589b47102 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 15 Nov 2018 16:18:12 +0100 Subject: Don't forward view, send updates instead To avoid inconsistencies in the federation, now the origin server will tell other instances what is the correct number of views --- server/controllers/api/videos/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'server/controllers') diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 664154406..e654bdd09 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -405,7 +405,11 @@ async function viewVideo (req: express.Request, res: express.Response) { const serverActor = await getServerActor() - await sendCreateView(serverActor, videoInstance, undefined) + // Send the event to the origin server + // If we own the video, we'll send an update event when we'll process the views (in our job queue) + if (videoInstance.isOwned() === false) { + await sendCreateView(serverActor, videoInstance, undefined) + } return res.status(204).end() } -- cgit v1.2.3