X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Ffriends.js;h=eafffaab01571676072e5eaa19a62c4a163654ba;hb=4b08096b2c58f801e5aad19e38d24ec59dd3e14e;hp=3f100545c28796912cac22877cea0895c54381bb;hpb=3737bbafb109a79f77c3047eb9b2791e6b57344e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/friends.js b/server/lib/friends.js index 3f100545c..eafffaab0 100644 --- a/server/lib/friends.js +++ b/server/lib/friends.js @@ -28,7 +28,7 @@ const friends = { } function addVideoToFriends (video) { - createRequest('add', video) + createRequest('add', constants.REQUEST_ENDPOINTS.VIDEOS, video) } function hasFriends (callback) { @@ -119,7 +119,7 @@ function quitFriends (callback) { } function removeVideoToFriends (videoParams) { - createRequest('remove', videoParams) + createRequest('remove', constants.REQUEST_ENDPOINTS.VIDEOS, videoParams) } function sendOwnedVideosToPod (podId) { @@ -137,7 +137,7 @@ function sendOwnedVideosToPod (podId) { return } - createRequest('add', remoteVideo, [ podId ]) + createRequest('add', constants.REQUEST_ENDPOINTS.VIDEOS, remoteVideo, [ podId ]) }) }) }) @@ -250,8 +250,9 @@ function makeRequestsToWinningPods (cert, podsList, callback) { }) } -function createRequest (type, data, to) { +function createRequest (type, endpoint, data, to) { const req = new Request({ + endpoint, request: { type: type, data: data