git ssb

2+

ev / mvd



Commit ec37df6152816fa77dfcb298c81f92f36b2e6483

use ssb-avatar for git-ssb repo names

Ev Bogue committed on 10/11/2018, 6:23:43 PM
Parent: 3bcc91fcae6c48d06f5545ce345fd00f9d7b7fa3

Files changed

render.jschanged
views.jschanged
render.jsView
@@ -59,9 +59,8 @@
5959 return message
6060 }
6161
6262
63-
6463 else if (msg.value.content.type == 'scat_message') {
6564 var src = hash()
6665 if (src != 'backchannel') {
6766 message.appendChild(h('button.btn.right', h('a', {href: '#backchannel'}, 'Chat')))
@@ -103,21 +102,21 @@
103102 var cloneurl = h('pre', 'git clone ssb://' + msg.value.content.repo)
104103
105104 message.appendChild(reponame)
106105
107- pull(
108- sbot.get(msg.value.content.repo, function (err, data) {
109- //if (err) throw err
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 +
116114 message.appendChild(cloneurl)
117115
118116 var commits = h('ul')
119- if (msg.value.content.commits[0]) {
117 + //if (msg.value.content.commits[0]) {
118 + if (msg.value.content.commits) {
120119 msg.value.content.commits.map(function (commit) {
121120 commits.appendChild(h('li', h('code', commit.sha1), ' - ', commit.title))
122121 })
123122
views.jsView
@@ -353,9 +353,9 @@
353353 content.appendChild(rootMsg)
354354 }
355355 if (data.value.content.type == 'git-repo') {
356356 pull(
357- sbot.backlinks({query: [{$filter: {value: {content: {type: 'git-update'}}, dest: src}}], reverse: true}),
357 + sbot.backlinks({query: [{$filter: {value: {content: {type: 'git-update'}}, dest: src}}]}),
358358 pull.drain(function (msg) {
359359 if (msg.value) {
360360 content.appendChild(render(msg))
361361 }

Built with git-ssb-web