Commit dffd43f062a271d3a9be609e1129bf5ad153a4ff
Let people name themselves and support description in about
Anders Rune Jensen committed on 5/12/2017, 8:06:54 PMParent: f49493c61faed9bcaac665b3e01ce9e8b78ad47e
Files changed
lib/about.js | changed |
lib/about.js | |||
---|---|---|---|
@@ -5,20 +5,22 @@ | |||
5 | 5 … | return typeof val === 'string' ? val : val && val.link | |
6 | 6 … | } | |
7 | 7 … | ||
8 | 8 … | function reduceAbout(about, msg) { | |
9 | - var c = msg.value.content | ||
10 | - if (!c) return about | ||
11 | - if (c.name) about.name = c.name.replace(/^@?/, '@') | ||
12 | - if (c.image) about.image = linkDest(c.image) | ||
13 | - return about | ||
9 … | + var c = msg.value.content | ||
10 … | + if (!c) return about | ||
11 … | + if (c.name) about.name = c.name.replace(/^@?/, '@') | ||
12 … | + if (c.image) about.image = linkDest(c.image) | ||
13 … | + if (c.description) about.description = c.description | ||
14 … | + return about | ||
14 | 15 … | } | |
15 | 16 … | ||
16 | 17 … | module.exports = function (sbot, id, cb) { | |
17 | 18 … | var about = {} | |
18 | 19 … | pull( | |
19 | 20 … | sbot.links({ | |
20 | 21 … | rel: 'about', | |
22 … | + source: id, | ||
21 | 23 … | dest: id, | |
22 | 24 … | values: true, | |
23 | 25 … | }), | |
24 | 26 … | pull.collect(function (err, msgs) { |
Built with git-ssb-web