diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2019-04-08 11:40:09 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2019-04-08 11:45:10 -1000 |
commit | 4d1395740db1ddebaa558f2c27d29ab772e74936 (patch) | |
tree | f0e7937ba02a7ef6235da7340af0f8bb48075b06 /lib | |
parent | 5c782b79a38d0ec6a29c019a55ef66a1b6000acf (diff) | |
download | patchfoo-4d1395740db1ddebaa558f2c27d29ab772e74936.tar.gz patchfoo-4d1395740db1ddebaa558f2c27d29ab772e74936.zip |
Render private about messages more compactly
Diffstat (limited to 'lib')
-rw-r--r-- | lib/render-msg.js | 11 |
1 files changed, 7 insertions, 4 deletions
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([ |