diff options
Diffstat (limited to 'server/lib/friends.ts')
-rw-r--r-- | server/lib/friends.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/server/lib/friends.ts b/server/lib/friends.ts index 50355d5d1..bd3ff97a5 100644 --- a/server/lib/friends.ts +++ b/server/lib/friends.ts | |||
@@ -242,6 +242,23 @@ function fetchRemotePreview (pod: PodInstance, video: VideoInstance) { | |||
242 | return request.get(REMOTE_SCHEME.HTTP + '://' + host + path) | 242 | return request.get(REMOTE_SCHEME.HTTP + '://' + host + path) |
243 | } | 243 | } |
244 | 244 | ||
245 | function removeFriend (pod: PodInstance) { | ||
246 | const requestParams = { | ||
247 | method: 'POST' as 'POST', | ||
248 | path: '/api/' + API_VERSION + '/remote/pods/remove', | ||
249 | toPod: pod | ||
250 | } | ||
251 | |||
252 | return makeSecureRequest(requestParams) | ||
253 | .then(() => pod.destroy()) | ||
254 | .then(() => { | ||
255 | logger.info('Removed friend.') | ||
256 | }) | ||
257 | .catch(err => { | ||
258 | logger.error('Some errors while quitting friend %s (id: %d).', pod.host, pod.id, err) | ||
259 | }) | ||
260 | } | ||
261 | |||
245 | function getRequestScheduler () { | 262 | function getRequestScheduler () { |
246 | return requestScheduler | 263 | return requestScheduler |
247 | } | 264 | } |
@@ -268,6 +285,7 @@ export { | |||
268 | hasFriends, | 285 | hasFriends, |
269 | makeFriends, | 286 | makeFriends, |
270 | quitFriends, | 287 | quitFriends, |
288 | removeFriend, | ||
271 | removeVideoToFriends, | 289 | removeVideoToFriends, |
272 | sendOwnedVideosToPod, | 290 | sendOwnedVideosToPod, |
273 | getRequestScheduler, | 291 | getRequestScheduler, |