diff options
Diffstat (limited to 'server/lib/friends.js')
-rw-r--r-- | server/lib/friends.js | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/server/lib/friends.js b/server/lib/friends.js index 1e8037c37..2ea837c99 100644 --- a/server/lib/friends.js +++ b/server/lib/friends.js | |||
@@ -3,13 +3,13 @@ | |||
3 | const each = require('async/each') | 3 | const each = require('async/each') |
4 | const eachLimit = require('async/eachLimit') | 4 | const eachLimit = require('async/eachLimit') |
5 | const eachSeries = require('async/eachSeries') | 5 | const eachSeries = require('async/eachSeries') |
6 | const fs = require('fs') | ||
7 | const request = require('request') | 6 | const request = require('request') |
8 | const waterfall = require('async/waterfall') | 7 | const waterfall = require('async/waterfall') |
9 | 8 | ||
10 | const constants = require('../initializers/constants') | 9 | const constants = require('../initializers/constants') |
11 | const db = require('../initializers/database') | 10 | const db = require('../initializers/database') |
12 | const logger = require('../helpers/logger') | 11 | const logger = require('../helpers/logger') |
12 | const peertubeCrypto = require('../helpers/peertube-crypto') | ||
13 | const requests = require('../helpers/requests') | 13 | const requests = require('../helpers/requests') |
14 | 14 | ||
15 | const ENDPOINT_ACTIONS = constants.REQUEST_ENDPOINT_ACTIONS[constants.REQUEST_ENDPOINTS.VIDEOS] | 15 | const ENDPOINT_ACTIONS = constants.REQUEST_ENDPOINT_ACTIONS[constants.REQUEST_ENDPOINTS.VIDEOS] |
@@ -19,7 +19,6 @@ const friends = { | |||
19 | updateVideoToFriends, | 19 | updateVideoToFriends, |
20 | reportAbuseVideoToFriend, | 20 | reportAbuseVideoToFriend, |
21 | hasFriends, | 21 | hasFriends, |
22 | getMyCertificate, | ||
23 | makeFriends, | 22 | makeFriends, |
24 | quitFriends, | 23 | quitFriends, |
25 | removeVideoToFriends, | 24 | removeVideoToFriends, |
@@ -74,15 +73,11 @@ function hasFriends (callback) { | |||
74 | }) | 73 | }) |
75 | } | 74 | } |
76 | 75 | ||
77 | function getMyCertificate (callback) { | ||
78 | fs.readFile(constants.CONFIG.STORAGE.CERT_DIR + 'peertube.pub', 'utf8', callback) | ||
79 | } | ||
80 | |||
81 | function makeFriends (hosts, callback) { | 76 | function makeFriends (hosts, callback) { |
82 | const podsScore = {} | 77 | const podsScore = {} |
83 | 78 | ||
84 | logger.info('Make friends!') | 79 | logger.info('Make friends!') |
85 | getMyCertificate(function (err, cert) { | 80 | peertubeCrypto.getMyPublicCert(function (err, cert) { |
86 | if (err) { | 81 | if (err) { |
87 | logger.error('Cannot read public cert.') | 82 | logger.error('Cannot read public cert.') |
88 | return callback(err) | 83 | return callback(err) |