From e5e85d8d4b9555741d9648089848f97795088dee Mon Sep 17 00:00:00 2001 From: DrSmoothl <1787882683@qq.com> Date: Thu, 21 May 2026 08:10:16 +0800 Subject: [PATCH] fix(file): consult upload cache when emitting transElem(24) in forwards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `send_forward_msg` with a `{type:'file', file_id}` segment to a GROUP was sending a 0 B file (no name, no size, no md5/sha1) because `makeGroupFileElem` read those fields directly off `MessageElement` without falling back to `bridge.recallUploadedFile()`. The c2c forward path in `apis/forward.ts::buildForwardPushBody` already does this lookup (line ~126) — that's why forwarding to a private chat worked but to a group didn't. Mirror it here. OneBot11 callers typically thread only the file_id through (the upload action returns just the id), so the cached metadata is the only place size/md5/sha1/name come from. Without it the long-msg payload encodes `GroupFileExtra { fileSize=0, fileName='', md5='', fileSha='' }` and the receiver renders a "0 B" file bubble. --- packages/core/src/bridge/element-builder.ts | 27 +++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/packages/core/src/bridge/element-builder.ts b/packages/core/src/bridge/element-builder.ts index 6469adaf..9a4fa111 100644 --- a/packages/core/src/bridge/element-builder.ts +++ b/packages/core/src/bridge/element-builder.ts @@ -256,18 +256,31 @@ async function makePttElem(ctx: SendContext, element: MessageElement): Promise