mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 20:40:43 +00:00
fix: preserve discord inbound media filenames
This commit is contained in:
@@ -295,6 +295,7 @@ async function appendResolvedMediaFromAttachments(params: {
|
||||
fetched.contentType ?? attachment.content_type,
|
||||
"inbound",
|
||||
params.maxBytes,
|
||||
attachment.filename,
|
||||
);
|
||||
params.out.push({
|
||||
path: saved.path,
|
||||
@@ -402,6 +403,7 @@ async function appendResolvedMediaFromStickers(params: {
|
||||
fetched.contentType,
|
||||
"inbound",
|
||||
params.maxBytes,
|
||||
candidate.fileName,
|
||||
);
|
||||
params.out.push({
|
||||
path: saved.path,
|
||||
|
||||
@@ -94,7 +94,13 @@ function expectSinglePngDownload(params: {
|
||||
});
|
||||
expectDiscordCdnSsrFPolicy(call.ssrfPolicy);
|
||||
expect(saveMediaBuffer).toHaveBeenCalledTimes(1);
|
||||
expect(saveMediaBuffer).toHaveBeenCalledWith(expect.any(Buffer), "image/png", "inbound", 512);
|
||||
expect(saveMediaBuffer).toHaveBeenCalledWith(
|
||||
expect.any(Buffer),
|
||||
"image/png",
|
||||
"inbound",
|
||||
512,
|
||||
params.filePathHint,
|
||||
);
|
||||
expect(params.result).toEqual([
|
||||
{
|
||||
path: params.expectedPath,
|
||||
|
||||
Reference in New Issue
Block a user