mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
🐛修复 hook ipc 时获取不到 callbackId 导致其他插件 ipc 通信失败
This commit is contained in:
parent
1f02c98c8f
commit
f79581d97e
@ -58,14 +58,14 @@ export function startHook() {
|
|||||||
event.sender[senderExclude] = true
|
event.sender[senderExclude] = true
|
||||||
event.sender.send = new Proxy(event.sender.send, {
|
event.sender.send = new Proxy(event.sender.send, {
|
||||||
apply(target, thisArg, args: [channel: string, meta: Dict, data: Dict[]]) {
|
apply(target, thisArg, args: [channel: string, meta: Dict, data: Dict[]]) {
|
||||||
if (args[1].eventName?.startsWith('ns-LoggerApi')) {
|
if (args[1]?.eventName?.startsWith('ns-LoggerApi')) {
|
||||||
return target.apply(thisArg, args)
|
return target.apply(thisArg, args)
|
||||||
}
|
}
|
||||||
if (logHook) {
|
if (logHook) {
|
||||||
log('received', args)
|
log('received', args)
|
||||||
}
|
}
|
||||||
|
|
||||||
const callbackId = args[1].callbackId
|
const callbackId = args[1]?.callbackId
|
||||||
if (callbackId) {
|
if (callbackId) {
|
||||||
if (hookApiCallbacks[callbackId]) {
|
if (hookApiCallbacks[callbackId]) {
|
||||||
Promise.resolve(hookApiCallbacks[callbackId](args[2]))
|
Promise.resolve(hookApiCallbacks[callbackId](args[2]))
|
||||||
@ -97,7 +97,7 @@ export function startHook() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return target.apply(thisArg, args)
|
return target.apply(thisArg, args)
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user