From 3d17926481e111702214f8e183feadce6d3dd1eb Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Fri, 27 Apr 2018 06:11:15 +0200 Subject: [PATCH] player can see spectator chat after the game is over --- app/controllers/Round.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/Round.scala b/app/controllers/Round.scala index 095bf46094..30bf1cfdc1 100644 --- a/app/controllers/Round.scala +++ b/app/controllers/Round.scala @@ -203,7 +203,9 @@ object Round extends LilaController with TheftPrevention { tourId ?? { Env.tournament.api.miniView(_, withTop) } private[controllers] def getWatcherChat(game: GameModel)(implicit ctx: Context): Fu[Option[lila.chat.UserChat.Mine]] = { - ctx.noKid && ctx.me.exists(Env.chat.panic.allowed) && !ctx.userId.exists(game.userIds.contains) + ctx.noKid && ctx.me.exists(Env.chat.panic.allowed) && { + game.finishedOrAborted || !ctx.userId.exists(game.userIds.contains) + } } ?? { Env.chat.api.userChat.findMineIf(Chat.Id(s"${game.id}/w"), ctx.me, !game.justCreated) flatMap { chat => Env.user.lightUserApi.preloadMany(chat.chat.userIds) inject chat.some