public async Task StartDirectConverstation(NewConversationDto dto) { var currentUser = await GetCurrentUserAsync(); var conversation = conversationRepository.CreateAsync(currentUser.Id, dto.RecipientIds[0], dto.Text); var message = conversation.Messages.First(); Broastcast("conversation.new", conversation.ToDto(), dto.RecipientIds); Broastcast("message.sent", message.ToDto(), dto.RecipientIds); }
public ActionResult NewConversation(NewConversationDto newConversationDto) { if (ModelState.IsValid) { var currentUser = (User)Session["CurrentUser"]; var newConversation = this.conversationService.AddConversationWithInitialMessage(currentUser.Identity, newConversationDto.NewMessage, newConversationDto.NewConversationTitle); return(RedirectToAction("Conversation", new { conversationId = newConversation.ConversationID })); } return(View(newConversationDto)); }
public ActionResult NewConversation() { var newConversationDto = new NewConversationDto(); return(View(newConversationDto)); }