Simplify recall check for self-operated messages
Some checks are pending
Build Action / Build-LiteLoader (push) Waiting to run
Build Action / Build-Shell (push) Waiting to run

This commit is contained in:
手瓜一十雪 2025-08-25 13:04:22 +08:00
parent ac6e593315
commit d4b0a4acca

View File

@ -305,9 +305,7 @@ export class NapCatOneBot11Adapter {
}; };
let msg = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeq(peer, msgSeq)).msgList.find(e => e.msgType == NTMsgType.KMSGTYPEGRAYTIPS); let msg = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeq(peer, msgSeq)).msgList.find(e => e.msgType == NTMsgType.KMSGTYPEGRAYTIPS);
const element = msg?.elements.find(e => !!e.grayTipElement?.revokeElement); const element = msg?.elements.find(e => !!e.grayTipElement?.revokeElement);
let isSelfOperateDevice = element?.grayTipElement?.revokeElement.operatorUid == this.core.selfInfo.uid; if (msg && element?.grayTipElement?.revokeElement.isSelfOperate) {
// 其它设备的UID是不一样的 UID跟设备有关 从而放掉其它设备来的recall 避免二次吞掉recall
if (msg && element?.grayTipElement?.revokeElement.isSelfOperate && isSelfOperateDevice) {
await this.core.eventWrapper.registerListen('NodeIKernelMsgListener/onMsgRecall', await this.core.eventWrapper.registerListen('NodeIKernelMsgListener/onMsgRecall',
(chatType: ChatType, uid: string, msgSeq: string) => { (chatType: ChatType, uid: string, msgSeq: string) => {
return chatType === msg?.chatType && uid === msg?.peerUid && msgSeq === msg?.msgSeq; return chatType === msg?.chatType && uid === msg?.peerUid && msgSeq === msg?.msgSeq;