测试:修改任务好友军团活动
This commit is contained in:
@@ -251,7 +251,7 @@ function createChatRec(sender: boolean, curTime: Date, targetRoleId) {
|
||||
* @param {Date} curTime
|
||||
*/
|
||||
async function updateRecentChats(sender: boolean, roleId: string, targetRoleId: string, curTime: Date) {
|
||||
const chatInfo = await ChatInfoModel.findInfo(roleId);
|
||||
const chatInfo = await roleChatInfos(roleId);
|
||||
let recentPrivateChats: PrivateChatRec[] = chatInfo?.recentPrivateChats||[]
|
||||
const recIdx = recentPrivateChats.findIndex(chat => { return chat.targetRoleId === targetRoleId });
|
||||
if (recIdx === -1) {
|
||||
@@ -269,7 +269,11 @@ async function updateRecentChats(sender: boolean, roleId: string, targetRoleId:
|
||||
/**
|
||||
* @description 获取聊天信息
|
||||
*/
|
||||
export async function roleChatInfos(roleId: string, roleName: string) {
|
||||
export async function roleChatInfos(roleId: string, roleName?: string) {
|
||||
if(!roleName) {
|
||||
let role = await RoleModel.findByRoleId(roleId, 'roleName');
|
||||
roleName = role.roleName;
|
||||
}
|
||||
let result = await ChatInfoModel.findInfo(roleId);
|
||||
if (!result) {
|
||||
result = await ChatInfoModel.createInfo({ roleId, roleName });
|
||||
|
||||
Reference in New Issue
Block a user