Пример #1
0
 public Task SendUserMessage(string user, string message)
 => UserHandler.FindAgent(user) == null
     ? Clients.Caller.SendMessage("target user not found")
     : Clients.Client(UserHandler.FindAgent(user).connectionId).SendMessage(message);
Пример #2
0
 public Task UpdateNickname(string newName)
 => UserHandler.ChangeNickname(Context.ConnectionId, newName)
         ? Clients.All.UpdateNickname(newName)
         : Clients.Caller.SendBroadcastMessage("Failed to update name");
Пример #3
0
 public Task GetParticipants() => Clients.All.SendParticipants(UserHandler.AllAgentsInDescendingOrder().Select(u => u.nickname).ToList());
Пример #4
0
 public Task SendUserlist() => Clients.Caller.SendUserlist(UserHandler.AllAgentsInDescendingOrder());