From 4d1395740db1ddebaa558f2c27d29ab772e74936 Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 8 Apr 2019 11:40:09 -1000 Subject: Render private about messages more compactly --- lib/render-msg.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/render-msg.js b/lib/render-msg.js index 44d8665..a4f2664 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -560,6 +560,7 @@ var knownAboutProps = { channel: true, type: true, root: true, + recps: true, branch: true, about: true, attendee: true, @@ -586,10 +587,12 @@ var knownAboutProps = { } RenderMsg.prototype.about = function (cb) { - var keys = Object.keys(this.c).sort().join() + var keys = Object.keys(this.c).filter(function (k) { + return k !== 'about' && k !== 'type' && k !== 'recps' + }).sort().join() var isSelf = this.c.about === this.msg.value.author - if (keys === 'about,name,type') { + if (keys === 'name') { return this.wrapMini([ isSelf ? 'self-identifies as ' : @@ -598,7 +601,7 @@ RenderMsg.prototype.about = function (cb) { ], cb) } - if (keys === 'about,publicWebHosting,type') { + if (keys === 'publicWebHosting') { var public = this.c.publicWebHosting && this.c.publicWebHosting !== 'false' return this.wrapMini([ isSelf ? @@ -615,7 +618,7 @@ RenderMsg.prototype.about = function (cb) { var elCb = done() var isAttendingMsg = u.linkDest(this.c.attendee) === this.msg.value.author - && keys === 'about,attendee,type' + && keys === 'attendee' if (isAttendingMsg) { var attending = !this.c.attendee.remove this.wrapMini([ -- cgit v1.2.3