public override async Task OnConnectedAsync() { var roomId = await _chatRoomService.CreateRoom(Context.ConnectionId); await Groups.AddToGroupAsync(Context.ConnectionId, roomId.ToString()); await Clients.Caller.SendAsync("ReceiveMessage", "Tayyab Bhatti", DateTimeOffset.UtcNow, "Hello! what can I help You"); await base.OnConnectedAsync(); }
public override async Task OnConnectedAsync() { var roomId = await _chatRoomService.CreateRoom(Context.ConnectionId); await Groups.AddToGroupAsync(Context.ConnectionId, roomId.ToString()); await Clients.Caller.SendAsync("ReceiveMessage" , "Explore California" , DateTimeOffset.UtcNow , "Hello! Waht can we help you?"); await base.OnConnectedAsync(); }
public override async Task OnConnectedAsync() { var roomId = await _chatRoomService.CreateRoom(Context.ConnectionId); await Groups.AddToGroupAsync(Context.ConnectionId, roomId.ToString()); await Clients.Caller.SendAsync("ReciveMessage", "TopLearn Support", DateTimeOffset.UtcNow, "Hello ! What can we help you with today ?"); await base.OnConnectedAsync(); }
public override async Task OnConnectedAsync() { var roomId = await _chatRoomService.CreateRoom(Context.ConnectionId); await Groups.AddToGroupAsync( Context.ConnectionId, roomId.ToString()); await Clients.Caller.SendAsync( "ReceiveMessage", "WebSignalR", DateTimeOffset.UtcNow, "Pozdrav..."); await base.OnConnectedAsync(); }
public async Task <IActionResult> CreateRoom(ChatRoomCreateViewModel roomVM) { var room = new ChatRoom { Name = roomVM.Name, OwnerID = HttpContext.GetUserID() }; if (!string.IsNullOrEmpty(roomVM.Password)) { room.Password = BCrypt.Net.BCrypt.HashPassword(roomVM.Password, BCrypt.Net.BCrypt.GenerateSalt()); } var id = await _roomService.CreateRoom(room); return(RedirectToAction("Room", new { roomId = id })); }
public override async Task OnConnectedAsync() { if (Context.User.Identity.IsAuthenticated) { // Authenticated agents don't need a room await base.OnConnectedAsync(); return; } var roomId = await _chatRoomService.CreateRoom( Context.ConnectionId); await Groups.AddToGroupAsync( Context.ConnectionId, roomId.ToString()); await Clients.Caller.SendAsync( "ReceiveMessage", "Explore California", DateTimeOffset.UtcNow, "Hello! What can we help you with today?"); await base.OnConnectedAsync(); }
public async Task <IActionResult> SaveChatRoom(CreateRoomDto chatRoom) { await _chatRoomService.CreateRoom(chatRoom); return(StatusCode(201)); }