Add an indicator in the friends list, to know if the friend is currently in a game.
This avoids sending an invitation that may be ignored, and avoids waiting for the invitation to be accepted without knowing that the invited player is in a game at that moment.
