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