public async Task WebSendMessage(WebSendMessageMessage message) { var state = GetState(ConnectionKind.Web); if (state == null) { _logger.LogWarning($"No state for WebSendMessage"); return; } if (string.IsNullOrEmpty(message.To) || string.IsNullOrEmpty(message.Body) || message.Body.Length > 5000 || message.To.Length > 32) { return; } string data = FormattableString.Invariant($"[\"{ArmaSerializer.Escape(message.To)}\",\"{ArmaSerializer.Escape(message.Body)}\"]"); await Clients.Group(state.ArmaChannelName).SendAsync("Callback", "SendMessage", data); }
private static string ToData(IdMessage message) { return(FormattableString.Invariant($"[\"{ArmaSerializer.Escape(message.Id)}\"]")); }