Files: 5285e716749369d47e938077f6d87389eb282ba9 / plugins / replicate / index.js
940 bytesRaw
1 | |
2 | |
3 | var Legacy = require('./legacy') |
4 | var mdm = require('mdmanifest') |
5 | var apidoc = require('../../lib/apidocs').replicate |
6 | var Notify = require('pull-notify') |
7 | var pull = require('pull-stream') |
8 | |
9 | module.exports = { |
10 | name: 'replicate', |
11 | version: '2.0.0', |
12 | manifest: mdm.manifest(apidoc), |
13 | //replicate: replicate, |
14 | init: function (ssbServer, config) { |
15 | var notify = Notify(), upto |
16 | if(!config.replicate || config.replicate.legacy !== false) { |
17 | var replicate = Legacy.call(this, ssbServer, notify, config) |
18 | |
19 | // replication policy is set by calling |
20 | // ssbServer.replicate.request(id) |
21 | // or by cancelling replication |
22 | // ssbServer.replicate.request(id, false) |
23 | // this is currently performed from the ssb-friends plugin |
24 | |
25 | return replicate |
26 | } |
27 | else |
28 | return { |
29 | request: function () {}, |
30 | changes: function () { return function (abort, cb) { cb(true) } } |
31 | } |
32 | } |
33 | } |
34 | |
35 |
Built with git-ssb-web