git ssb

1+

punkmonk.termux / mvd



forked from ev / mvd

Tree: d2b5693b01842e3376dae3c3cf5c579e03e490c4

Files: d2b5693b01842e3376dae3c3cf5c579e03e490c4 / plugins / replicate / index.js

940 bytesRaw
1'use strict'
2
3var Legacy = require('./legacy')
4var mdm = require('mdmanifest')
5var apidoc = require('../../lib/apidocs').replicate
6var Notify = require('pull-notify')
7var pull = require('pull-stream')
8
9module.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