Created
December 1, 2011 20:43
-
-
Save paulbatum/1419708 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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