public async Task <IActionResult> AnnounceText() { if (!User.Identity.IsAuthenticated) { return(Content(_localizer["You need to be logged in"])); } if (HttpContext.GetAccountInfo()?.AccessLevel < 100) { return(Content(_localizer["Not enough access level"])); } var text = Request.Form["annText"]; var response = await _requestService.AnnounceTextAsync(text); if (response.ResponseCode == 200) { return(Content("ok:" + _localizer["Successfully announced!"])); } return(Content(response.ResponseMessage)); }
public async Task <IActionResult> AnnounceText() { if (!User.Identity.IsAuthenticated) { return(Content("You need to be logged in")); } if (HttpContext.GetAccountInfo()?.AccessLevel < 100) { return(Content("Oh f**k off")); } var text = Request.Form["annText"]; var response = await _requestService.AnnounceTextAsync(text); if (response.ResponseCode == 200) { return(Content("ok:" + response.ResponseMessage)); } return(Content(response.ResponseMessage)); }