Style git messages better

This commit is contained in:
Anders Rune Jensen
2017-05-12 13:38:48 +02:00
parent 1b057d84aa
commit bff02dfad0
2 changed files with 25 additions and 6 deletions
+18
View File
@@ -107,6 +107,7 @@ exports.init = function (sbot, config) {
paramap(addAuthorAbout, 8),
paramap(addFollowAbout, 8),
paramap(addVoteMessage, 8),
paramap(addGitLinks, 8),
pull(renderThread(defaultOpts), wrapPage(about.name)),
toPull(res, function (err) {
if (err) console.error('[viewer]', err)
@@ -296,6 +297,23 @@ exports.init = function (sbot, config) {
cb(null, msg)
})
}
function addGitLinks(msg, cb) {
if (msg.value.content.type == 'git-update')
getMsg(msg.value.content.repo, function (err, gitRepo) {
if (gitRepo)
msg.value.content.repoName = gitRepo.value.content.name
cb(null, msg)
})
else if (msg.value.content.type == 'issue')
getMsg(msg.value.content.project, function (err, gitRepo) {
if (gitRepo)
msg.value.content.repoName = gitRepo.value.content.name
cb(null, msg)
})
else
cb(null, msg)
}
}
function serveBlob(req, res, sbot, id) {