/// <summary> /// 检查消息发送结果 /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void sendMessageResultHandler(object sender, MessageArcEventArgs args) { if (args.ArcInfo.TalkId != target?.accid) { return; } void action() { if (args.ArcInfo.Response != ResponseCode.kNIMResSuccess) { Messages.showError("发送失败"); return; } mmeInput.EditValue = null; mmeInput.Select(); } while (!(Parent?.IsHandleCreated ?? false)) { Thread.Sleep(100); } Invoke((Action)action); }
static void OnSendMsgCompletedCallback(string result, IntPtr ptr) { if (SendSysMsgHandler != null) { MessageArcEventArgs args = null; if (!string.IsNullOrEmpty(result)) { var msg = MessageAck.Deserialize(result); args = new MessageArcEventArgs(msg); } SendSysMsgHandler(null, args); } }
void SendMessageResultHandler(object sender, MessageArcEventArgs args) { if (args.ArcInfo.Response == ResponseCode.kNIMResSuccess && args.ArcInfo.TalkId == _peerId) { _lastSendedMsgId = args.ArcInfo.MsgId; } if (args.ArcInfo.Response == ResponseCode.kNIMResSuccess || args.ArcInfo.TalkId != _peerId) { return; } Action action = () => { MessageBox.Show(args.Dump(), "发送失败"); }; this.Invoke(action); }
private void OnSendSysMsg(object sender, MessageArcEventArgs e) { ShowOperationResult(new { Code = e.ArcInfo.Response, Tid = e.ArcInfo.TalkId, Mid = e.ArcInfo.MsgId }); }