diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-08-09 15:03:07 -0700 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-08-09 15:03:07 -0700 |
commit | 31301646eb23b3edcc23cb3cb8980ed451b0c108 (patch) | |
tree | 30aedcad4b6fed2f2377d703986ea1aa3f06ea82 /lib/render-msg.js | |
parent | e9c8e944c7d46091a5b7e1480deb8951137f629c (diff) | |
download | patchfoo-31301646eb23b3edcc23cb3cb8980ed451b0c108.tar.gz patchfoo-31301646eb23b3edcc23cb3cb8980ed451b0c108.zip |
Render chess invite/accept messages more compactly
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r-- | lib/render-msg.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js index 2bc382e..f351039 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -1322,7 +1322,7 @@ RenderMsg.prototype.chessInvite = function (cb) { var myColor = self.c.myColor self.link(self.c.inviting, function (err, link) { if (err) return cb(err) - self.wrap([ + self.wrapMini([ 'invites ', link, ' to play chess', // myColor ? h('p', 'my color is ' + myColor) : '' ], cb) @@ -1344,12 +1344,16 @@ RenderMsg.prototype.chessInviteTitle = function (cb) { RenderMsg.prototype.chessInviteAccept = function (cb) { var self = this - self.link(self.c.root, function (err, rootLink) { + self.getMsg(self.c.root, function (err, rootMsg) { if (err) return cb(err) - self.wrap([ - h('div', h('small', '> ', rootLink)), - h('p', 'accepts invitation to play chess') - ], cb) + self.link(rootMsg.value.author, function (err, rootAuthorLink) { + if (err) return cb(err) + self.wrapMini([ + 'accepts ', + h('a', {href: self.toUrl(rootMsg.key)}, 'invitation to play chess'), ' ', + 'with ', rootAuthorLink + ], cb) + }) }) } |