only show game study if made by a player
parent
d88d82484f
commit
8631b6028d
|
@ -61,6 +61,8 @@ case class Game(
|
|||
def hasUserIds(userId1: User.ID, userId2: User.ID) =
|
||||
playerByUserId(userId1).isDefined && playerByUserId(userId2).isDefined
|
||||
|
||||
def hasUserId(userId: User.ID) = playerByUserId(userId).isDefined
|
||||
|
||||
def opponent(p: Player): Player = opponent(p.color)
|
||||
|
||||
def opponent(c: Color): Player = player(!c)
|
||||
|
|
|
@ -157,7 +157,7 @@ final private class ChapterMaker(
|
|||
)
|
||||
|
||||
def notifyChat(study: Study, game: Game, userId: User.ID) =
|
||||
if (study.isPublic) List(game.id, s"${game.id}/w") foreach { chatId =>
|
||||
if (study.isPublic) List(game hasUserId userId option game.id, s"${game.id}/w".some).flatten foreach { chatId =>
|
||||
chatApi.userChat.write(
|
||||
chatId = Chat.Id(chatId),
|
||||
userId = userId,
|
||||
|
|
Loading…
Reference in New Issue