diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-04-30 10:31:46 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-05-01 20:33:46 -1000 |
commit | 3d93a6b19ffbce96e6bf66e1b91a9b99e561bece (patch) | |
tree | 4f1cae7c8920077d076c1ebc5465021f11da28c5 /lib | |
parent | d916b2b55d7aa5492b505693ee3263e3b10395b8 (diff) | |
download | patchfoo-3d93a6b19ffbce96e6bf66e1b91a9b99e561bece.tar.gz patchfoo-3d93a6b19ffbce96e6bf66e1b91a9b99e561bece.zip |
Render more gathering messages
Diffstat (limited to 'lib')
-rw-r--r-- | lib/render-msg.js | 21 |
1 files changed, 20 insertions, 1 deletions
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) +} |