git ssb

7+

dinoworm 🐛 / patchcore



Commit e69a4bdedf11f26f5a8b25434154fefafbf6ba2a

message.async.name: use ssb-about for repo names, gatherings

Matt McKegg committed on 6/27/2017, 6:10:11 AM
Parent: 380013df047c95a38eea7cd197f6aa74e2a83dfe

Files changed

message/async/name.jschanged
package.jsonchanged
message/async/name.jsView
@@ -1,11 +1,12 @@
11 const nest = require('depnest')
2-const getAvatar = require('ssb-avatar')
32 const ref = require('ssb-ref')
3 +const {resolve, onceTrue} = require('mutant')
44
55 exports.needs = nest({
66 'sbot.async.get': 'first',
77 'sbot.pull.links': 'first',
8 + 'about.obs.socialValue': 'first',
89 'keys.sync.id': 'first'
910 })
1011 exports.gives = nest('message.async.name')
1112
@@ -24,21 +25,22 @@
2425 }
2526 } else if (typeof value.content.text === 'string') {
2627 return cb(null, value.content.type + ': ' + titleFromMarkdown(value.content.text, 30))
2728 } else {
28- getAboutName(id, cb)
29 + return getAboutName(id, cb)
2930 }
3031
3132 return cb(null, fallbackName)
3233 })
3334 })
3435
3536 function getAboutName (id, cb) {
36- getAvatar({
37- links: api.sbot.pull.links,
38- get: api.sbot.async.get
39- }, api.keys.sync.id(), id, function (_, avatar) {
40- cb(null, avatar && avatar.name || id.substring(0, 10) + '...')
37 + var name = api.about.obs.socialValue(id, 'name')
38 + var title = api.about.obs.socialValue(id, 'title')
39 +
40 + onceTrue(name.sync, () => {
41 + console.log(id, resolve(name), resolve(title))
42 + cb(null, resolve(name) || resolve(title) || id.substring(0, 10) + '...')
4143 })
4244 }
4345 }
4446
package.jsonView
@@ -48,9 +48,8 @@
4848 "pull-stream": "^3.5.0",
4949 "simple-mime": "^0.1.0",
5050 "sorted-array-functions": "^1.0.0",
5151 "split-buffer": "^1.0.0",
52- "ssb-avatar": "^0.2.0",
5352 "ssb-client": "^4.4.0",
5453 "ssb-config": "^2.2.0",
5554 "ssb-feed": "^2.3.0",
5655 "ssb-keys": "^7.0.9",

Built with git-ssb-web