/// <summary> /// 添加路由消息 /// </summary> /// <param name="msgInterface"></param> public void AddMessage(IMsgInterface msgInterface) { foreach (var item in msgInterface.MsgInfos) { AddMessage(item.Value); } }
/// <summary> /// 接受到服务的消息 /// </summary> /// <param name="msgInterface"></param> public void ReciverFromServerMsg(IMsgInterface msgInterface) { foreach (var item in msgInterface.MsgInfos.Values) { if (item.MessageType == InterfaceLib.MsgInterface.MsgInfo.Enums.MessageType.File) { ServerInterface.SendMsgToDispla(id, "SmartQQ插件不支持,非文本信息处理!"); } else { dealWithMessage(item as ITextInfo); } } }
/// <summary> /// 从服务接受信息 /// </summary> /// <param name="msgInterface"></param> public void ReciverFromServerMsg(IMsgInterface msgInterface) { try { foreach (var item in msgInterface.MsgInfos) { //if(item.Value.MessageType == InterfaceLib.MsgInterface.MsgInfo.Enums.MessageType.File) //{ // Log.Write("FileMessage", item.Value.SendId); //} MessageCallBack?.Invoke(item.Value); } } catch (Exception ex) { Log.Write(ex); } }
/// <summary> /// 路由消息 /// </summary> /// <param name="msgInterface"></param> public void SendToMessage(IMsgInterface msgInterface) { MessageRouteInfo.AddMessage(msgInterface); }