render.jsView |
---|
59 | 59 | return message |
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | | - |
64 | 63 | else if (msg.value.content.type == 'scat_message') { |
65 | 64 | var src = hash() |
66 | 65 | if (src != 'backchannel') { |
67 | 66 | message.appendChild(h('button.btn.right', h('a', {href: '#backchannel'}, 'Chat'))) |
103 | 102 | var cloneurl = h('pre', 'git clone ssb://' + msg.value.content.repo) |
104 | 103 | |
105 | 104 | message.appendChild(reponame) |
106 | 105 | |
107 | | - pull( |
108 | | - sbot.get(msg.value.content.repo, function (err, data) { |
109 | | - |
110 | | - if (data.content.name) { |
111 | | - actualname = h('p', 'pushed to ', h('a', {href: '#' + msg.value.content.repo}, '%' + data.content.name)) |
112 | | - reponame.parentNode.replaceChild(actualname, reponame) |
113 | | - } else { console.log('no repo name') } |
114 | | - }) |
115 | | - ) |
| 106 | + var ssbAvatar = require('ssb-avatar') |
| 107 | + |
| 108 | + ssbAvatar(sbot, id, msg.value.content.repo, function (err, data) { |
| 109 | + if (data) |
| 110 | + var actualname = h('p', 'pushed to ', h('a', {href: '#' + msg.value.content.repo}, '%' + data.name)) |
| 111 | + reponame.parentNode.replaceChild(actualname, reponame) |
| 112 | + }) |
| 113 | + |
116 | 114 | message.appendChild(cloneurl) |
117 | 115 | |
118 | 116 | var commits = h('ul') |
119 | | - if (msg.value.content.commits[0]) { |
| 117 | + |
| 118 | + if (msg.value.content.commits) { |
120 | 119 | msg.value.content.commits.map(function (commit) { |
121 | 120 | commits.appendChild(h('li', h('code', commit.sha1), ' - ', commit.title)) |
122 | 121 | }) |
123 | 122 | |