git ssb

7+

dinoworm 🐛 / patchcore



Commit 0189703ad10f5344bd2d2972f16bf2c6f12102fd

teach publish to push all blobs it finds in message content object

mix irving committed on 12/9/2017, 6:51:02 AM
Parent: e21f2b88c4a0d94551c3bb63a46d01588e4eb85f

Files changed

package.jsonchanged
sbot.jschanged
package.jsonView
@@ -36,8 +36,9 @@
3636 "color-hash": "^1.0.3",
3737 "depnest": "^1.0.2",
3838 "emoji-named-characters": "^1.0.2",
3939 "es2040": "^1.2.4",
40 + "flat": "^4.0.0",
4041 "hashlru": "^2.2.0",
4142 "html-escape": "^2.0.0",
4243 "human-time": "0.0.1",
4344 "mutant": "^3.21.2",
sbot.jsView
@@ -6,8 +6,9 @@
66 var createClient = require('ssb-client')
77 var createFeed = require('ssb-feed')
88 var nest = require('depnest')
99 var ssbKeys = require('ssb-keys')
10 +var flat = require('flat')
1011
1112 exports.needs = nest({
1213 'config.sync.load': 'first',
1314 'keys.sync.load': 'first',
@@ -152,12 +153,12 @@
152153 if (content.recps) {
153154 content = ssbKeys.box(content, content.recps.map(e => {
154155 return ref.isFeed(e) ? e : e.link
155156 }))
156- } else if (content.mentions) {
157- content.mentions.forEach(mention => {
158- if (ref.isBlob(mention.link)) {
159- sbot.blobs.push(mention.link, err => {
157 + } else {
158 + Object.keys(flat(content)).forEach(val => {
159 + if (ref.isBlob(val)) {
160 + sbot.blobs.push(val, err => {
160161 if (err) console.error(err)
161162 })
162163 }
163164 })

Built with git-ssb-web