diff --git a/Realtime/Internal/Controller/LCIMRcpController.cs b/Realtime/Internal/Controller/LCIMRcpController.cs new file mode 100644 index 0000000..7760117 --- /dev/null +++ b/Realtime/Internal/Controller/LCIMRcpController.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; +using LeanCloud.Realtime.Protocol; + +namespace LeanCloud.Realtime.Internal.Controller { + internal class LCIMRcpController : LCIMController { + internal LCIMRcpController(LCIMClient client) : base(client) { + + } + + #region 消息处理 + + internal override async Task OnNotification(GenericCommand notification) { + RcpCommand rcp = notification.RcpMessage; + string convId = rcp.Cid; + string msgId = rcp.Id; + long timestamp = rcp.T; + bool isRead = rcp.Read; + string fromId = rcp.From; + LCIMConversation conversation = await Client.GetOrQueryConversation(convId); + if (isRead) { + Client.OnMessageRead?.Invoke(conversation, msgId); + } else { + Client.OnMessageDelivered?.Invoke(conversation, msgId); + } + } + + #endregion + } +}