refactor: 精简逻辑

This commit is contained in:
手瓜一十雪 2024-07-29 10:12:41 +08:00
parent 5613450313
commit 606eccd22b
2 changed files with 4 additions and 12 deletions

View File

@ -103,11 +103,11 @@ export class NTQQMsgApi {
static async fetchFavEmojiList(num: number) {
return napCatCore.session.getMsgService().fetchFavEmojiList("", num, true, true)
}
static async queryMsgsWithFilterExWithSeq(peer: Peer, msgSeq: string, msgTime: string, senderUid: string) {
let ret = await napCatCore.session.getMsgService().queryMsgsWithFilterEx('0', msgTime, msgSeq, {
static async queryMsgsWithFilterExWithSeq(peer: Peer, msgSeq: string) {
let ret = await napCatCore.session.getMsgService().queryMsgsWithFilterEx('0', '0', msgSeq, {
chatInfo: peer,
filterMsgType: [],
filterSendersUid: [senderUid],
filterSendersUid: [],
filterMsgToTime: '0',
filterMsgFromTime: '0',
isReverseOrder: false,

View File

@ -150,16 +150,8 @@ export class OB11Constructor {
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 || element.replyElement.replayMsgSeq !== replyMsg.msgSeq) {
replyMsg = (await NTQQMsgApi.queryMsgsWithFilterExWithSeq(
peer,
element.replyElement.replayMsgSeq,
'0',
'0'
)).msgList[0];
}
if (!replyMsg || element.replyElement.replayMsgSeq !== replyMsg.msgSeq) {
replyMsg = (await NTQQMsgApi.getSingleMsg(peer, element.replyElement.replayMsgSeq)).msgList[0];
}