aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-10-22 13:05:44 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-10-22 13:05:44 -1000
commit069af0cdf671deed1e378cb735985ac302a5c568 (patch)
treed289c05c60106488ea3c0817fe9db2cf468ec9e6 /lib
parent2ccd1ae36809bb7793ae2b663ccec0f348fba459 (diff)
downloadpatchfoo-069af0cdf671deed1e378cb735985ac302a5c568.tar.gz
patchfoo-069af0cdf671deed1e378cb735985ac302a5c568.zip
Render chess_chat messages
Diffstat (limited to 'lib')
-rw-r--r--lib/render-msg.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index c5d4756..b4ce016 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -253,6 +253,8 @@ RenderMsg.prototype.message = function (cb) {
case 'chess_game_end':
case 'ssb_chess_game_end':
return this.chessGameEnd(cb)
+ case 'chess_chat':
+ return this.chessChat(cb)
case 'wifi-network': return this.wifiNetwork(cb)
case 'mutual/credit': return this.mutualCredit(cb)
case 'mutual/account': return this.mutualAccount(cb)
@@ -377,6 +379,8 @@ RenderMsg.prototype.title1 = function (cb) {
cb(null, self.c.record && JSON.stringify(self.c.record.data) || self.msg.key)
else if (self.c.type === 'npm-publish')
self.npmPublishTitle(cb)
+ else if (self.c.type === 'chess_chat')
+ cb(null, title(self.c.msg))
else
self.app.getAbout(self.msg.key, function (err, about) {
if (err) return cb(err)
@@ -1175,6 +1179,17 @@ RenderMsg.prototype.chessGameEnd = function (cb) {
})
}
+RenderMsg.prototype.chessChat = function (cb) {
+ var self = this
+ self.link(self.c.root, function (err, rootLink) {
+ if (err) return cb(err)
+ self.wrap([
+ h('div', h('small', '> ', rootLink)),
+ h('p', self.c.msg)
+ ], cb)
+ })
+}
+
RenderMsg.prototype.chessMove = function (cb) {
if (this.opts.full) return this.chessMoveFull(cb)
return this.chessMoveMini(cb)