fix(protocol): restore forward image media and drop file receipts

Bot-built merged forwards left hollow NT images after long-msg fetch,
so get_forward_msg returned empty file/url. Decode now rebuilds identity
from md5, ignores stubs, and forward uploads keep a legacy image sibling.

C2C offline-file download receipts were reported as the peer sending a
file. Treat downloadFlag=2 as a receipt and drop it from the chat stream.
This commit is contained in:
DrSmoothl committed 2026-09-12 13:56:55 +08:00
1 parent 455763f109
commit 4379e4838d
10 files changed
+340 -24

No files matched your search

@@ -259,7 +259,8 @@ export const ELEMENT_CODECS = {
const url = ctx.imageUrlResolver ? await ctx.imageUrlResolver(element, ctx.isGroup) : (element.imageUrl ?? '');
const data: JsonObject = {
url,
file: element.fileId ?? '',
file: element.fileId
|| (element.md5Hex ? `${element.md5Hex.toLowerCase()}.png` : ''),
sub_type: element.subType ?? 0,
summary: element.summary ?? '',
};