aboutsummaryrefslogtreecommitdiff
path: root/lib/render-msg.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-05-30 18:00:06 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-05-30 18:00:06 -1000
commit59b921ee52497f2d94c9693a8f4a31eeb5bdbc46 (patch)
tree4c4241fd5c9840ab1e801f8c53d6ab7838003bd0 /lib/render-msg.js
parent6f04462393dc718d7d49780bd88c5fbd0aa98d72 (diff)
downloadpatchfoo-59b921ee52497f2d94c9693a8f4a31eeb5bdbc46.tar.gz
patchfoo-59b921ee52497f2d94c9693a8f4a31eeb5bdbc46.zip
Render attendee messages more concisely
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r--lib/render-msg.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 93e8f28..0c53894 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -381,9 +381,21 @@ function dateTime(d) {
}
RenderMsg.prototype.about = function (cb) {
- var img = u.linkDest(this.c.image)
var done = multicb({pluck: 1, spread: true})
var elCb = done()
+
+ var isAttendingMsg = u.linkDest(this.c.attendee) === this.msg.value.author
+ && Object.keys(this.c).sort().join() === 'about,attendee,type'
+ if (isAttendingMsg) {
+ var attending = !this.c.attendee.remove
+ this.wrapMini([
+ attending ? ' is attending' : ' is not attending', ' ',
+ this.link1(this.c.about, done())
+ ], elCb)
+ return done(cb)
+ }
+
+ var img = u.linkDest(this.c.image)
// if there is a description, it is likely to be multi-line
var hasDescription = this.c.description != null
var wrap = hasDescription ? this.wrap : this.wrapMini