Relay positive answers to invitations too, to simplify games list handling from client

This commit is contained in:
Tissevert 2020-01-11 21:33:52 +01:00
parent 0fa50ffb28
commit 65da786c69

View file

@ -50,8 +50,9 @@ receive invitation@(Message.Invitation {Message.to}) (Just _) =
receive answer@(Message.Answer {Message.accept, Message.to}) (Just player) =
if accept
then do
game <- Game.new (Player.playerID player, to)
Messaging.notifyPlayers game []
publicGames <- Game.new (Player.playerID player, to)
Messaging.relay answer (Messaging.sendTo [to])
Messaging.notifyPlayers publicGames
else Messaging.relay answer (Messaging.sendTo [to])
receive (Message.Play {Message.move, Message.onGame}) (Just player) = do