聊天:查看私聊消息的接口和测试
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user