fix: group notify db cache

This commit is contained in:
linyuchen
2024-03-10 22:44:33 +08:00
parent 192736c8be
commit eeadaa12e9
9 changed files with 64 additions and 33 deletions

View File

@@ -21,7 +21,7 @@ import {
CacheFileList, CacheFileListItem, CacheFileType,
} from "./types";
import * as fs from "fs";
import {friendRequests, groupNotifies, selfInfo, uidMaps} from "../common/data";
import {friendRequests, selfInfo, uidMaps} from "../common/data";
import {v4 as uuidv4} from "uuid"
import path from "path";
import {dbUtil} from "../common/db";
@@ -590,11 +590,11 @@ export class NTQQApi {
}
static async handleGroupRequest(seq: string, operateType: GroupRequestOperateTypes, reason?: string) {
const notify: GroupNotify = groupNotifies[seq];
const notify: GroupNotify = await dbUtil.getGroupNotify(seq)
if (!notify) {
throw `${seq}对应的加群通知不存在`
}
delete groupNotifies[seq];
// delete groupNotifies[seq];
return await callNTQQApi<GeneralCallResult>({
methodName: NTQQApiMethod.HANDLE_GROUP_REQUEST,
args: [

View File

@@ -366,7 +366,7 @@ export interface GroupNotifies {
export interface GroupNotify {
time: number; // 自己添加的字段,时间戳,毫秒, 用于判断收到短时间内收到重复的notify
seq: string, // 转成数字再除以1000应该就是时间戳
seq: string, // 唯一标识符,转成数字再除以1000应该就是时间戳
type: GroupNotifyTypes,
status: 0, // 未知
group: { groupCode: string, groupName: string },