mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 04:45:46 +00:00
fix: typo
This commit is contained in:
parent
8f54310f63
commit
67b47e39b4
@ -72,8 +72,9 @@ class LimitedHashTable<K, V> {
|
||||
return undefined;
|
||||
}
|
||||
const result: { key: K; value: V }[] = [];
|
||||
for (let i = 0; i < Math.min(size, keyList.length); i++) {
|
||||
const key = keyList[i];
|
||||
const listSize = Math.min(size, keyList.length);
|
||||
for (let i = 0; i < listSize; i++) {
|
||||
const key = keyList[listSize - i];
|
||||
result.push({ key, value: this.keyToValue.get(key)! });
|
||||
}
|
||||
return result;
|
||||
@ -92,8 +93,8 @@ class MessageUniqueWrapper {
|
||||
if (!heads) {
|
||||
return [];
|
||||
}
|
||||
let date = heads.map((t) => MessageUnique.getMsgIdAndPeerByShortId(t.value));
|
||||
let ret = date.filter((t) => t?.Peer.chatType === Peer.chatType && t?.Peer.peerUid === Peer.peerUid);
|
||||
let data = heads.map((t) => MessageUnique.getMsgIdAndPeerByShortId(t.value));
|
||||
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);
|
||||
}
|
||||
createMsg(peer: Peer, msgId: string): number | undefined {
|
||||
|
@ -147,10 +147,15 @@ export class OB11Constructor {
|
||||
peerUid: msg.peerUid,
|
||||
guildId: '',
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
|
||||
}
|
||||
if (!replyMsg || replyMsg.msgRandom !== records.msgRandom) {
|
||||
logWarn(`消息比对失败,准备重新尝试 Info: CurrentMsgRandom:${replyMsg?.msgRandom}/TargetMsgRandom:${records.msgRandom}`);
|
||||
await sleep(500);
|
||||
@ -161,12 +166,6 @@ export class OB11Constructor {
|
||||
records.senderUid
|
||||
)).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) {
|
||||
logWarn(`消息比对失败,准备重新尝试 Info: CurrentMsgRandom:${replyMsg?.msgRandom}/TargetMsgRandom:${records.msgRandom}`);
|
||||
throw new Error('回复消息消息验证失败')
|
||||
|
Loading…
Reference in New Issue
Block a user