fix(protocol): preserve sent media for message history

Keep media sent by the bot available for later history and forwarding,
including messages without a server echo.

Fixes #462
This commit is contained in:
DrSmoothl committed 2026-10-04 14:00:03 +08:00
1 parent 3068d3ef60
commit d86e0fc7b5
6 files changed
+51 -5

No files matched your search

@@ -182,5 +182,12 @@ export async function uploadImageMsgInfo(
label: 'image',
});
return finalizeMediaMsgInfo(upload, pic);
const encoded = finalizeMediaMsgInfo(upload, pic);
// Retain successful upload metadata for the caller's self-sent history.
Object.assign(element, {
md5Hex: image.md5Hex, sha1Hex: image.sha1Hex, fileSize: image.fileSize,
fileName: image.fileName, width: image.width, height: image.height,
picFormat: image.picFormat, subType: image.subType, summary: image.summary,
});
return encoded;
}