aboutsummaryrefslogtreecommitdiff
path: root/lib/render-msg.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-03-13 11:22:18 -0400
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-03-13 22:11:09 -0400
commit8804ea0353ffbfb5bc6fa82031d8eadfad6ce41a (patch)
tree09a0160bb0ed9242887f1aabc1f5ec1de7378413 /lib/render-msg.js
parent13b4d448ee2ee7f22bd19edc036d7504f85b742e (diff)
downloadpatchfoo-8804ea0353ffbfb5bc6fa82031d8eadfad6ce41a.tar.gz
patchfoo-8804ea0353ffbfb5bc6fa82031d8eadfad6ce41a.zip
link to post root and branch messages
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r--lib/render-msg.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 09eb3e2..23e236f 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -220,10 +220,21 @@ RenderMsg.prototype.markdown = function (cb) {
RenderMsg.prototype.post = function (cb) {
var self = this
- self.link(self.c.root, function (err, a) {
+ var done = multicb({pluck: 1, spread: true})
+ var branchDone = multicb({pluck: 1})
+ u.toArray(self.c.branch).forEach(function (branch) {
+ self.link(branch, branchDone())
+ })
+ if (self.c.root === self.c.branch) done()()
+ else self.link(self.c.root, done())
+ branchDone(done())
+ done(function (err, rootLink, branchLinks) {
if (err) return self.wrap(u.renderError(err), cb)
self.wrap(h('div.ssb-post',
- a ? h('div', h('small', 're: ', a)) : '',
+ rootLink ? h('div', h('small', '>> ', rootLink)) : '',
+ branchLinks.map(function (a, i) {
+ return h('div', h('small', '> ', a))
+ }),
h('div.ssb-post-text', {innerHTML: self.markdown()})
), cb)
})