public ActionResult ReparseMessages() { if (!this.HttpContext.Session.HasSystemActionRights() || !this.HttpContext.Session.HasSystemActionRight(ActionRights.SystemManagement)) { return(RedirectToAction("Index", "Home")); } var data = new ReparsingMessageData(); data.Completed = false; return(View("~/Views/Admin/ReparseMessages.cshtml", data)); }
public async Task <ActionResult> ReparseMessages(string submitAction) { if (!this.HttpContext.Session.HasSystemActionRights() || !this.HttpContext.Session.HasSystemActionRight(ActionRights.SystemManagement)) { return(RedirectToAction("Index", "Home")); } if (submitAction == "cancel") { return(RedirectToAction("Index", "Home")); } var data = new ReparsingMessageData(); Action <string> consoleLogger = s => Console.WriteLine(s); data.NumberOfMessagesReparsed = await MessageManager.ReParseMessagesAsync(ApplicationAdapter.GetEmojiFilenamesPerName(), ApplicationAdapter.GetSmileyMappings(), consoleLogger).ConfigureAwait(false); data.Completed = true; return(View("~/Views/Admin/ReparseMessages.cshtml", data)); }