聊天:查看私聊消息的接口和测试

This commit is contained in:
liangtongchuan
2021-03-11 10:24:10 +08:00
parent 9a2c536288
commit cce6a5af5e
5 changed files with 55 additions and 5 deletions
+10
View File
@@ -396,3 +396,13 @@ function shouldPushTowerMsg(lv: number) {
// 100 层之后每 50 层触发
return lv >= 100 && lv % 50 === 0;
}
export async function updatePrivateMsgReadTime(roleId: string, targetRoleId: string) {
const time = new Date();
const chatInfo = await ChatInfoModel.updateReadTime(roleId, targetRoleId, time);
if (!chatInfo || !chatInfo.recentPrivateChats) {
return null;
}
const chatRec = chatInfo.recentPrivateChats.find(rec => { return rec.targetRoleId === targetRoleId });
return chatRec;
}