From 6555c2435dab0c77c06927b2f62df1f3d95542e3 Mon Sep 17 00:00:00 2001 From: hanhu Date: Thu, 14 Jan 2021 10:39:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=89=E5=8D=93=E7=AB=AF?= =?UTF-8?q?=20-=20=E6=9C=AA=E8=AF=BB=E6=A0=87=E8=AE=B0=E5=9C=A8=E6=9D=80?= =?UTF-8?q?=E6=8E=89=E5=BA=94=E7=94=A8=E5=86=8D=E6=89=93=E5=BC=80=EF=BC=8C?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=E6=B6=88=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- standard/model/external.ts | 3 +++ standard/model/message.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/standard/model/external.ts b/standard/model/external.ts index d16b906..c5f29f2 100644 --- a/standard/model/external.ts +++ b/standard/model/external.ts @@ -20,6 +20,9 @@ export async function onMessageReceived( ext.extend_message_body.messageType == 5) { originMessage.ext.shouldRead = true; delegate.im.conversation.updateMessageExt(originMessage.messageId, originMessage.ext); + } else { + originMessage.ext.shouldRead = false; + delegate.im.conversation.updateMessageExt(originMessage.messageId, originMessage.ext); } const message = Action.Parse.get([], originMessage, originMessage); diff --git a/standard/model/message.ts b/standard/model/message.ts index c98e8fe..99dd7c2 100644 --- a/standard/model/message.ts +++ b/standard/model/message.ts @@ -25,7 +25,7 @@ export async function sendMessage( isSystem: boolean = false, autoTimestamp: boolean = true, ): Promise { - ext = {...ext, innerId: message.innerId}; + ext = {...ext, innerId: message.innerId, shouldRead: true}; const sendEventName = [Event.Base, Event.SendMessage, imId]; if (!delegate.model.Conversation.getOne(imId, false)) { await delegate.model.Conversation.loadItem(imId, chatType);