git ssb

30+

cel / git-ssb-web



Commit 229088888b146cdab7bf94e133046ee8ed2bea3b

Get About info from target message as fallback

This allows a repo to be named by its root git-repo message
Charles Lehner committed on 9/25/2016, 6:06:30 PM
Parent: 942f807171e0484c1b1cbb63d8275c528df5e36d

Files changed

lib/about.jschanged
lib/about.jsView
@@ -10,8 +10,9 @@
1010 var pull = require('pull-stream')
1111 var cat = require('pull-cat')
1212 var asyncMemo = require('asyncmemo')
1313 var u = require('./util')
14 +var ref = require('ssb-ref')
1415
1516 function getLink(obj) {
1617 return typeof obj === 'string' ? obj : obj ? obj.link : null
1718 }
@@ -64,8 +65,18 @@
6465 rel: 'about',
6566 values: true,
6667 reverse: true
6768 }),
69 + // Finally, get About info from the thing itself (if possible)
70 + u.readOnce(function (cb) {
71 + if (ref.isMsg(target)) {
72 + sbot.get(target, function (err, value) {
73 + cb(null, {key: target, value: value})
74 + })
75 + } else {
76 + cb()
77 + }
78 + })
6879 ]),
6980 pull.filter(function (msg) {
7081 return msg && msg.value && msg.value.content
7182 }),

Built with git-ssb-web