chore: limit ack.

oneRain 2020-12-17 18:05:23 +08:00
parent 778cb622b6
commit 0b72527130
1 changed files with 5 additions and 5 deletions

View File

@ -234,15 +234,15 @@ namespace LeanCloud.Realtime.Internal.Controller {
message.MentionIdList.Contains(Client.Id); message.MentionIdList.Contains(Client.Id);
message.PatchedTimestamp = direct.PatchTimestamp; message.PatchedTimestamp = direct.PatchTimestamp;
message.IsTransient = direct.Transient; message.IsTransient = direct.Transient;
// 通知服务端已接收
if (!message.IsTransient) {
// 只有非暂态消息才需要发送 ack
_ = Ack(message.ConversationId, message.Id);
}
// 获取对话 // 获取对话
LCIMConversation conversation = await Client.GetOrQueryConversation(direct.Cid); LCIMConversation conversation = await Client.GetOrQueryConversation(direct.Cid);
conversation.Unread++; conversation.Unread++;
conversation.LastMessage = message; conversation.LastMessage = message;
// 通知服务端已接收
if (!(conversation is LCIMChatRoom) && !message.IsTransient) {
// 只有非暂态消息才需要发送 ack
_ = Ack(message.ConversationId, message.Id);
}
Client.OnMessage?.Invoke(conversation, message); Client.OnMessage?.Invoke(conversation, message);
} }