diff --git a/Realtime/Internal/Controller/LCIMConversationController.cs b/Realtime/Internal/Controller/LCIMConversationController.cs index c6143b5..caee6fe 100644 --- a/Realtime/Internal/Controller/LCIMConversationController.cs +++ b/Realtime/Internal/Controller/LCIMConversationController.cs @@ -105,26 +105,6 @@ namespace LeanCloud.Realtime.Internal.Controller { return response.ConvMessage.Count; } - /// - /// 标记对话的消息已读 - /// - /// - /// - /// - internal async Task Read(string convId, - LCIMMessage message) { - ReadCommand read = new ReadCommand(); - ReadTuple tuple = new ReadTuple { - Cid = convId, - Mid = message.Id, - Timestamp = message.SentTimestamp - }; - read.Convs.Add(tuple); - GenericCommand request = NewCommand(CommandType.Read, OpType.Open); - request.ReadMessage = read; - await Client.Connection.SendRequest(request); - } - /// /// 更新对话属性 /// diff --git a/Realtime/Internal/Controller/LCIMMessageController.cs b/Realtime/Internal/Controller/LCIMMessageController.cs index f845d14..fad359a 100644 --- a/Realtime/Internal/Controller/LCIMMessageController.cs +++ b/Realtime/Internal/Controller/LCIMMessageController.cs @@ -139,6 +139,43 @@ namespace LeanCloud.Realtime.Internal.Controller { return null; } + /// + /// 确认收到消息 + /// + /// + /// + /// + internal async Task Ack(string convId, + string msgId) { + AckCommand ack = new AckCommand { + Cid = convId, + Mid = msgId + }; + GenericCommand request = NewCommand(CommandType.Ack); + request.AckMessage = ack; + await Client.Connection.SendRequest(request); + } + + /// + /// 确认已读消息 + /// + /// + /// + /// + internal async Task Read(string convId, + LCIMMessage msg) { + ReadCommand read = new ReadCommand(); + ReadTuple tuple = new ReadTuple { + Cid = convId, + Mid = msg.Id, + Timestamp = msg.SentTimestamp + }; + read.Convs.Add(tuple); + GenericCommand request = NewCommand(CommandType.Read, OpType.Open); + request.ReadMessage = read; + await Client.Connection.SendRequest(request); + } + #endregion #region 消息处理