Files: 1d955c3387cdf42644ed019ae648fe45559ac290 / modules / avatar-name.js
577 bytesRaw
1 | |
2 | var signifers = require('../plugs').first(exports.signifers = []) |
3 | |
4 | exports.avatar_name = |
5 | function name (id) { |
6 | var n = h('span', id.substring(0, 10)) |
7 | |
8 | //choose the most popular name for this person. |
9 | //for anything like this you'll see I have used sbot.links2 |
10 | //which is the ssb-links plugin. as you'll see the query interface |
11 | //is pretty powerful! |
12 | //TODO: "most popular" name is easily gameable. |
13 | //must come up with something better than this. |
14 | |
15 | exports.signifiers(id, function (_, names) { |
16 | if(names.length) n.textContent = names[0].name |
17 | }) |
18 | |
19 | return n |
20 | } |
21 | |
22 |
Built with git-ssb-web