aboutsummaryrefslogtreecommitdiff
path: root/lib/render-msg.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-02-02 11:33:17 -0800
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-02-04 02:53:53 -0800
commitbcd5d6924eb4729b6a85e50c3e91495d0c55d3f6 (patch)
treef34d956016a8788f7bee9026359c32a8dca05ab3 /lib/render-msg.js
parent27ba4ec88776b1f30f31f01e313bdef2096d0705 (diff)
downloadpatchfoo-bcd5d6924eb4729b6a85e50c3e91495d0c55d3f6.tar.gz
patchfoo-bcd5d6924eb4729b6a85e50c3e91495d0c55d3f6.zip
Omit message author from private recipients list
Save space by not having the author listed twice
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r--lib/render-msg.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 666e5ff..96f3b86 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -146,9 +146,12 @@ RenderMsg.prototype.wrapMini = function (content, cb) {
}
RenderMsg.prototype.recpsLine = function (cb) {
- return this.msg.value.private
- ? this.render.privateLine(this.c.recps, cb)
- : (cb(), '')
+ if (!this.msg.value.private) return cb(), ''
+ var author = this.msg.value.author
+ var recpsNotSelf = u.toArray(this.c.recps).filter(function (link) {
+ return u.linkDest(link) !== author
+ })
+ return this.render.privateLine(recpsNotSelf, cb)
}
RenderMsg.prototype.recpsIds = function () {