Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 7dcf79f

Browse files
Merge pull request #1106 from ssbc/re-enable-ssb-ebt
feat: re-enable ssb-ebt
2 parents c330dbf + f7bf001 commit 7dcf79f

File tree

4 files changed

+337
-292
lines changed

4 files changed

+337
-292
lines changed

lib/plugins/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,20 @@ exports.init = function (ssb, config) {
178178
})
179179
)
180180

181+
// update ebt with latest block info
182+
pull(
183+
patchwork.contacts.raw.stream({ live: true }),
184+
pull.drain((data) => {
185+
if (!data) return
186+
for (var from in data) {
187+
for (var to in data[from]) {
188+
var value = data[from][to]
189+
ssb.ebt.block(from, to, value === false)
190+
}
191+
}
192+
})
193+
)
194+
181195
// use blocks in legacy replication (adapted from ssb-friends for legacy compat)
182196
ssb.createHistoryStream.hook(function (fn, args) {
183197
const opts = args[0]

lib/server-process.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const createSbot = require('secret-stack')()
4040
.use(require('ssb-search'))
4141
.use(require('ssb-ws'))
4242
.use(require('ssb-tags'))
43-
// .use(require('ssb-ebt')) // enable at your own risk!
43+
.use(require('ssb-ebt'))
4444
.use(require('./plugins'))
4545

4646
fixPath()

0 commit comments

Comments
 (0)