Skip to content

Instantly share code, notes, and snippets.

@paulbatum
Created December 1, 2011 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulbatum/1419708 to your computer and use it in GitHub Desktop.
Save paulbatum/1419708 to your computer and use it in GitHub Desktop.
private void DisconnectClient(string clientId)
{
ChatUser user = _service.DisconnectClient(clientId);
// There's no associated user for this client id
if (user == null)
{
return;
}
// The user will be marked as offline if all clients leave
if (user.Status == (int)UserStatus.Offline)
{
foreach (var room in user.Rooms)
{
var userViewModel = new UserViewModel(user);
Clients[room.Name].leave(userViewModel, room.Name).Wait();
OnRoomCountChanged(room);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment