let tournament owner join the chat - closes #6553

This commit is contained in:
Thibault Duplessis 2020-05-06 09:28:43 -06:00
parent 8fb165bea0
commit 3f0d187f2a

View file

@ -73,7 +73,7 @@ final class Tournament(
private[controllers] def canHaveChat(tour: Tour, json: Option[JsObject])(implicit ctx: Context): Boolean =
tour.hasChat && !ctx.kid && // no public chats for kids
ctx.me.fold(!tour.isPrivate) { u => // anon can see public chats, except for private tournaments
(!tour.isPrivate || json.fold(true)(jsonHasMe) || isGranted(
(!tour.isPrivate || json.fold(true)(jsonHasMe) || ctx.userId.has(tour.createdBy) || isGranted(
_.ChatTimeout
)) && // private tournament that I joined or has ChatTimeout
env.chat.panic.allowed(u, tighter = tour.variant == chess.variant.Antichess)