mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix: typo
This commit is contained in:
@@ -72,8 +72,9 @@ class LimitedHashTable<K, V> {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
const result: { key: K; value: V }[] = [];
|
const result: { key: K; value: V }[] = [];
|
||||||
for (let i = 0; i < Math.min(size, keyList.length); i++) {
|
const listSize = Math.min(size, keyList.length);
|
||||||
const key = keyList[i];
|
for (let i = 0; i < listSize; i++) {
|
||||||
|
const key = keyList[listSize - i];
|
||||||
result.push({ key, value: this.keyToValue.get(key)! });
|
result.push({ key, value: this.keyToValue.get(key)! });
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -92,8 +93,8 @@ class MessageUniqueWrapper {
|
|||||||
if (!heads) {
|
if (!heads) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
let date = heads.map((t) => MessageUnique.getMsgIdAndPeerByShortId(t.value));
|
let data = heads.map((t) => MessageUnique.getMsgIdAndPeerByShortId(t.value));
|
||||||
let ret = date.filter((t) => t?.Peer.chatType === Peer.chatType && t?.Peer.peerUid === Peer.peerUid);
|
let ret = data.filter((t) => t?.Peer.chatType === Peer.chatType && t?.Peer.peerUid === Peer.peerUid);
|
||||||
return ret.map((t) => t?.MsgId).filter((t) => t !== undefined);
|
return ret.map((t) => t?.MsgId).filter((t) => t !== undefined);
|
||||||
}
|
}
|
||||||
createMsg(peer: Peer, msgId: string): number | undefined {
|
createMsg(peer: Peer, msgId: string): number | undefined {
|
||||||
|
@@ -147,10 +147,15 @@ export class OB11Constructor {
|
|||||||
peerUid: msg.peerUid,
|
peerUid: msg.peerUid,
|
||||||
guildId: '',
|
guildId: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
let replyMsg: RawMessage | undefined;
|
let replyMsg: RawMessage | undefined;
|
||||||
|
replyMsg = (await NTQQMsgApi.getMsgsBySeqAndCount({ peerUid: msg.peerUid, guildId: '', chatType: msg.chatType }, element.replyElement.replayMsgSeq, 1, true, true)).msgList[0];
|
||||||
|
|
||||||
|
if (!replyMsg || replyMsg.msgRandom !== records.msgRandom) {
|
||||||
|
logWarn(`消息比对失败,准备重新尝试 Info: CurrentMsgRandom:${replyMsg?.msgRandom}/TargetMsgRandom:${records.msgRandom}`);
|
||||||
|
await sleep(500);
|
||||||
replyMsg = (await NTQQMsgApi.getMsgsByMsgId(peer, MessageUnique.getRecentMsgIds(peer, 50))).msgList.find((msg) => msg.msgRandom == records.msgRandom && msg.msgSeq == element.replyElement.replayMsgSeq);
|
replyMsg = (await NTQQMsgApi.getMsgsByMsgId(peer, MessageUnique.getRecentMsgIds(peer, 50))).msgList.find((msg) => msg.msgRandom == records.msgRandom && msg.msgSeq == element.replyElement.replayMsgSeq);
|
||||||
|
}
|
||||||
|
|
||||||
if (!replyMsg || replyMsg.msgRandom !== records.msgRandom) {
|
if (!replyMsg || replyMsg.msgRandom !== records.msgRandom) {
|
||||||
logWarn(`消息比对失败,准备重新尝试 Info: CurrentMsgRandom:${replyMsg?.msgRandom}/TargetMsgRandom:${records.msgRandom}`);
|
logWarn(`消息比对失败,准备重新尝试 Info: CurrentMsgRandom:${replyMsg?.msgRandom}/TargetMsgRandom:${records.msgRandom}`);
|
||||||
await sleep(500);
|
await sleep(500);
|
||||||
@@ -161,12 +166,6 @@ export class OB11Constructor {
|
|||||||
records.senderUid
|
records.senderUid
|
||||||
)).msgList[0];
|
)).msgList[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!replyMsg || replyMsg.msgRandom !== records.msgRandom) {
|
|
||||||
logWarn(`消息比对失败,准备重新尝试 Info: CurrentMsgRandom:${replyMsg?.msgRandom}/TargetMsgRandom:${records.msgRandom}`);
|
|
||||||
await sleep(500);
|
|
||||||
replyMsg = (await NTQQMsgApi.getMsgsBySeqAndCount({ peerUid: msg.peerUid, guildId: '', chatType: msg.chatType }, element.replyElement.replayMsgSeq, 1, true, true)).msgList[0];
|
|
||||||
}
|
|
||||||
if (!replyMsg || replyMsg.msgRandom !== records.msgRandom) {
|
if (!replyMsg || replyMsg.msgRandom !== records.msgRandom) {
|
||||||
logWarn(`消息比对失败,准备重新尝试 Info: CurrentMsgRandom:${replyMsg?.msgRandom}/TargetMsgRandom:${records.msgRandom}`);
|
logWarn(`消息比对失败,准备重新尝试 Info: CurrentMsgRandom:${replyMsg?.msgRandom}/TargetMsgRandom:${records.msgRandom}`);
|
||||||
throw new Error('回复消息消息验证失败')
|
throw new Error('回复消息消息验证失败')
|
||||||
|
Reference in New Issue
Block a user