git ssb

0+

ev / minbase



Tree: f1cc08ac986f18880000b780dae6fb2043e76948

Files: f1cc08ac986f18880000b780dae6fb2043e76948 / modules / getstars.js

634 bytesRaw
1var h = require('hyperscript')
2
3var config = require ('../config')()
4
5module.exports.getstars = function (msg, sbot) {
6 var star = config.emojiUrl + 'star.png'
7 var digs = h('a')
8
9 var votes = []
10 for(var k in CACHE) {
11 if (CACHE[k].content.vote != null) {
12 if(CACHE[k].content.type == 'vote' &&
13 (CACHE[k].content.vote == msg.key ||
14 CACHE[k].content.vote.link == msg.key
15 ))
16 votes.push({source: CACHE[k].author, dest: k, rel: 'vote'})
17 }
18 }
19 var digs
20 for (i = 0; i < votes.length; i++) {
21 digs = '<img src="' + star + '" class="emoji">' + digs
22 }
23 return h('span', {innerHTML: digs})
24}
25
26

Built with git-ssb-web