Use self UID and add OIDB timeout

fetchPrivateFileUrl now uses the current account UID (resolveSelfUid) as receiverUid instead of resolving the peer UID, matching Lagrange.Core/NapCat behavior and avoiding NTQQ fulllink handler timeouts. The userId parameter is intentionally unused. runOidb gained an optional timeoutMs argument and the private-file request uses a 5000ms timeout; bridge.sendRawPacket is forwarded this timeout.
This commit is contained in:
手瓜一十雪 committed 2026-05-20 17:26:39 +08:00
1 parent 2de1ff4f0d
commit 4b217eb4b8
2 files changed
+11 -4

No files matched your search

+2 -1
View File
@@ -84,8 +84,9 @@ export async function runOidb(
bridge: Bridge,
cmd: string,
envelopeBytes: Uint8Array,
timeoutMs?: number,
): Promise<Uint8Array> {
const result = await bridge.sendRawPacket(cmd, envelopeBytes);
const result = await bridge.sendRawPacket(cmd, envelopeBytes, timeoutMs);
if (!result.success) throw new Error(result.errorMessage || 'packet send failed');
if (!result.gotResponse) throw new Error(result.errorMessage || 'no response');