From a6fb417c7741c1d0a64baf2d4824ccf973e338bb Mon Sep 17 00:00:00 2001 From: cel Date: Sun, 22 Oct 2017 13:05:57 -1000 Subject: Clarify chess invite thread titles --- lib/render-msg.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/render-msg.js b/lib/render-msg.js index b4ce016..d36646e 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -381,6 +381,8 @@ RenderMsg.prototype.title1 = function (cb) { self.npmPublishTitle(cb) else if (self.c.type === 'chess_chat') cb(null, title(self.c.msg)) + else if (self.c.type === 'chess_invite') + self.chessInviteTitle(cb) else self.app.getAbout(self.msg.key, function (err, about) { if (err) return cb(err) @@ -1135,6 +1137,19 @@ RenderMsg.prototype.chessInvite = function (cb) { }) } +RenderMsg.prototype.chessInviteTitle = function (cb) { + var self = this + var done = multicb({pluck: 1, spread: true}) + self.getName(self.c.inviting, done()) + self.getName(self.msg.value.author, done()) + done(function (err, inviteeLink, inviterLink) { + if (err) return cb(err) + self.wrap([ + 'chess: ', inviterLink, ' vs. ', inviteeLink + ], cb) + }) +} + RenderMsg.prototype.chessInviteAccept = function (cb) { var self = this self.link(self.c.root, function (err, rootLink) { -- cgit v1.2.3