public void OnUploadChatFinishCallBack(string jsonContent) { //decode json Dictionary <string, object> root = Json.Deserialize(jsonContent) as Dictionary <string, object>; if (!root.ContainsKey("errCode")) { TipManager.Instance.Alert("发生未知错误,请重试"); return; } string errorCode = root["errCode"] as string; if (!string.IsNullOrEmpty(errorCode)) { TipManager.Instance.Alert("发生未知错误,请重试"); return; } string voicename = root["voiceName"] as string; string date = root["date"] as string; SendChatRequest request = new SendChatRequest(); request.ChatId = m_iChatId; request.VoiceDate = date; request.VoiceName = voicename; AsyncSendChatRequest async = new AsyncSendChatRequest(request); async.TryRequest(); // TEST CODE //DownloadChat(voicename,date); }
private void ChatBoxInput_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { SendChatRequest chatReq = new SendChatRequest(ChatBoxInput.Text); client.SendRequest(chatReq, currUser); ChatBoxInput.Clear(); ChatBox.SelectionStart = ChatBox.Text.Length; ChatBox.ScrollToCaret(); } }
public static Response SendChatRequestHandler(SendChatRequest arg) { List <User> usersInSystem = StarDatabaseCode.GetUsersInSystem(StarDatabaseCode.FindSystemByID(arg.sysID)); foreach (User u in usersInSystem) { if (arg.textToSend.Trim() != "") { RequestListener.alerter.SendAlerts(new ChatAlert(arg.name + ": " + arg.textToSend), u); } } return(Response.Ok()); }