aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-03-09 22:38:52 -0500
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-03-09 22:38:52 -0500
commitfc6c226031f569bd611380beff11fb0dd3f71093 (patch)
treed46d8dfae83056c54a18f136caca18b731ab75f3 /lib
parent1d4db3a4721841ca576ebd8585c263388262a064 (diff)
downloadpatchfoo-fc6c226031f569bd611380beff11fb0dd3f71093.tar.gz
patchfoo-fc6c226031f569bd611380beff11fb0dd3f71093.zip
Render issue-edit msgs
including legacy renames and reopens
Diffstat (limited to 'lib')
-rw-r--r--lib/render-msg.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 017e8f6..c99b206 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -193,6 +193,7 @@ RenderMsg.prototype.message = function (raw, cb) {
case 'git-update': return this.gitUpdate(cb)
case 'pull-request': return this.gitPullRequest(cb)
case 'issue': return this.issue(cb)
+ case 'issue-edit': return this.issueEdit(cb)
case 'music-release-cc': return this.musicRelease(cb)
case 'ferment/audio':
case 'robeson/audio':
@@ -435,6 +436,10 @@ RenderMsg.prototype.issue = function (cb) {
})
}
+RenderMsg.prototype.issueEdit = function (cb) {
+ this.wrap('', cb)
+}
+
RenderMsg.prototype.object = function (cb) {
this.wrapMini(h('pre', this.c.type), cb)
}
@@ -442,7 +447,15 @@ RenderMsg.prototype.object = function (cb) {
RenderMsg.prototype.issues = function (cb) {
var self = this
var done = multicb({pluck: 1, spread: true})
- var els = u.toArray(self.c.issues).map(function (issue) {
+ var issues = u.toArray(self.c.issues)
+ if (self.c.type === 'issue-edit' && self.c.issue) {
+ issues.push({
+ link: self.c.issue,
+ title: self.c.title,
+ open: self.c.open,
+ })
+ }
+ var els = issues.map(function (issue) {
var commit = issue.object || issue.label ? [
issue.object ? h('code', issue.object) : '', ' ',
issue.label ? h('q', issue.label) : ''] : ''
@@ -452,6 +465,12 @@ RenderMsg.prototype.issues = function (cb) {
if (issue.open === false)
return h('div',
'closed ', self.link1(issue, done()))
+ if (issue.open === true)
+ return h('div',
+ 'reopened ', self.link1(issue, done()))
+ if (typeof issue.title === 'string')
+ return h('div',
+ 'renamed ', self.link1(issue, done()), ' to ', h('ins', issue.title))
})
done(cb)
return els.length > 0 ? [els, h('br')] : ''