From 3d93a6b19ffbce96e6bf66e1b91a9b99e561bece Mon Sep 17 00:00:00 2001 From: cel Date: Sun, 30 Apr 2017 10:31:46 -1000 Subject: Render more gathering messages --- lib/render-msg.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/render-msg.js b/lib/render-msg.js index f28e9de..d7820b4 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -210,6 +210,7 @@ RenderMsg.prototype.message = function (cb) { case 'issue-edit': return this.issueEdit(cb) case 'music-release-cc': return this.musicRelease(cb) case 'ssb-dns': return this.dns(cb) + case 'gathering': return this.gathering(cb) case 'ferment/audio': case 'robeson/audio': return this.audio(cb) @@ -358,6 +359,13 @@ RenderMsg.prototype.link1 = function (link, cb) { return a } +function dateTime(d) { + var date = new Date(d.epoch) + return date.toUTCString() + // d.bias + // d.epoch +} + RenderMsg.prototype.about = function (cb) { var img = u.linkDest(this.c.image) var done = multicb({pluck: 1, spread: true}) @@ -371,7 +379,10 @@ RenderMsg.prototype.about = function (cb) { isSelf ? hasDescription ? 'self-describes' : 'self-identifies' : [hasDescription ? 'describes' : 'identifies', ' ', - h('a', {href: this.toUrl(this.c.about)}, truncate(this.c.about, 10))], + this.c.about + ? 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', @@ -381,6 +392,10 @@ RenderMsg.prototype.about = function (cb) { this.link1(this.c.attendee.link, done()), this.c.attendee.remove ? ' is not attending' : ' is attending' ) : '', + this.c.startDateTime ? h('div', + 'starting at ', dateTime(this.c.startDateTime)) : '', + this.c.endDateTime ? h('div', + 'ending at ', dateTime(this.c.endDateTime)) : '', this.c.location ? h('div', 'at ', this.c.location) : '', img ? h('a', {href: this.toUrl(img)}, h('img.ssb-avatar-image', { @@ -757,3 +772,7 @@ RenderMsg.prototype.mutualCredit = function (cb) { RenderMsg.prototype.mutualAccount = function (cb) { return this.object(cb) } + +RenderMsg.prototype.gathering = function (cb) { + this.wrapMini('gathering', cb) +} -- cgit v1.2.3