Commit 229088888b146cdab7bf94e133046ee8ed2bea3b
Get About info from target message as fallback
This allows a repo to be named by its root git-repo messageCharles Lehner committed on 9/25/2016, 6:06:30 PM
Parent: 942f807171e0484c1b1cbb63d8275c528df5e36d
Files changed
lib/about.js | changed |
lib/about.js | ||
---|---|---|
@@ -10,8 +10,9 @@ | ||
10 | 10 … | var pull = require('pull-stream') |
11 | 11 … | var cat = require('pull-cat') |
12 | 12 … | var asyncMemo = require('asyncmemo') |
13 | 13 … | var u = require('./util') |
14 … | +var ref = require('ssb-ref') | |
14 | 15 … | |
15 | 16 … | function getLink(obj) { |
16 | 17 … | return typeof obj === 'string' ? obj : obj ? obj.link : null |
17 | 18 … | } |
@@ -64,8 +65,18 @@ | ||
64 | 65 … | rel: 'about', |
65 | 66 … | values: true, |
66 | 67 … | reverse: true |
67 | 68 … | }), |
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 … | + }) | |
68 | 79 … | ]), |
69 | 80 … | pull.filter(function (msg) { |
70 | 81 … | return msg && msg.value && msg.value.content |
71 | 82 … | }), |
Built with git-ssb-web