public ActionResult StartRoom() { ChatUserModel user = CurrentUser; WebChat WC = new WebChat() { CurrentUser = user }; if (user != null) { MongoDBConnector.SetUserLastActionTime(user.UserName, DateTime.UtcNow); if (!user.IsAdmin) WC.AllChats = WC.AllChats.Where(c => c.AllowedUser.Contains(user.UserName)).ToList(); return View(WC); } else return RedirectToAction("ErrorPage", "Home", ErrorModel.LoginOrRegistration); }
public ActionResult GetCurrentState() { WebChat wc = new WebChat() { CurrentUser = CurrentUser }; return PartialView(wc); }