From e46be6be1dc1edb50867e971eced70a5a1e78295 Mon Sep 17 00:00:00 2001 From: cel Date: Thu, 20 Apr 2017 14:13:57 -0700 Subject: Render some patch-gathering about messages --- lib/render-msg.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/render-msg.js b/lib/render-msg.js index eadbcd1..786294f 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -308,7 +308,8 @@ RenderMsg.prototype.title = function (cb) { else self.app.getAbout(self.msg.key, function (err, about) { if (err) return cb(err) - if (about.name) return cb(null, about.name) + var name = about.name || about.title || about.description + if (name) return cb(null, name) self.message(false, function (err, el) { if (err) return cb(err) cb(null, '%' + title(h('div', el).textContent)) @@ -348,19 +349,28 @@ RenderMsg.prototype.link1 = function (link, cb) { RenderMsg.prototype.about = function (cb) { var img = u.linkDest(this.c.image) + var done = multicb({pluck: 1, spread: true}) + var elCb = done() this.wrapMini([ this.c.about === this.msg.value.author ? 'self-identifies' : ['identifies ', h('a', {href: this.toUrl(this.c.about)}, truncate(this.c.about, 10))], ' as ', this.c.name ? [h('ins', this.c.name), ' '] : '', this.c.description ? h('div', - {innerHTML: this.render.markdown(this.c.description)}) : h('br'), + {innerHTML: this.render.markdown(this.c.description)}) : '', + this.c.title ? h('h3', this.c.title) : '', + this.c.attendee ? h('div', + this.link1(this.c.attendee.id, done()), + this.c.attendee.remove ? ' is not attending' : ' is attending' + ) : '', + this.c.location ? h('div', 'at ', this.c.location) : '', img ? h('a', {href: this.toUrl(img)}, h('img.ssb-avatar-image', { src: this.render.imageUrl(img), alt: ' ', })) : '' - ], cb) + ], elCb) + done(cb) } RenderMsg.prototype.contact = function (cb) { -- cgit v1.2.3