public void RequestOnlineUsers() { var users = UserBO.GetAll(); var currentUser = Helper.CurrentUser; var list = new List <ClientChatUser>(); ClientChatUser user = null; for (int i = 0; i < users.Count; i++) { if (currentUser.Id == users[i].Id) { continue; } user = users[i].ToClientChatUser(); user.IsOnline = _UserOnlines.ContainsKey(users[i].Id); if (string.IsNullOrEmpty(user.Avatar)) { user.Avatar = users[i].Gender ? "/Content/img/avatar5.png" : "/Content/img/avatar3.png"; } user.OnlineStatus = user.IsOnline ? string.Empty : "offline-status"; list.Add(user); } chatClient.updateOnlineUsers(list); }
public void receiveSupporter(ClientChatUser chatUser) { _hub.Clients.Caller.receiveSupporter(chatUser); }
public void updateOfflineContacts(ClientChatUser user) { _hub.Clients.All.updateOfflineContacts(user); }