From 9fbd866435cf2322a2c8ec5de06c1880095276aa Mon Sep 17 00:00:00 2001 From: William Valentin Date: Mon, 16 Feb 2026 23:45:21 -0800 Subject: [PATCH] fix(channels): handle LINE and Zalo outbound attachment references --- src/channels/line/adapter.ts | 13 +++++++++++++ src/channels/zalo/adapter.ts | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/channels/line/adapter.ts b/src/channels/line/adapter.ts index e0baed2..1cd1898 100644 --- a/src/channels/line/adapter.ts +++ b/src/channels/line/adapter.ts @@ -169,6 +169,19 @@ export class LineAdapter implements ChannelAdapter { } finally { await rm(tempDir, { recursive: true, force: true }); } + + if (message.attachments && message.attachments.length > 0) { + for (const attachment of message.attachments) { + if (attachment.url) { + const line = attachment.filename ? `${attachment.filename}: ${attachment.url}` : attachment.url; + await this.sendPush(peerId, line); + continue; + } + if (attachment.data) { + console.warn(`LINE: skipping attachment data (${attachment.mimeType}) — upload not implemented`); + } + } + } } async handleRequest(req: IncomingMessage, res: ServerResponse): Promise { diff --git a/src/channels/zalo/adapter.ts b/src/channels/zalo/adapter.ts index 080be27..754781d 100644 --- a/src/channels/zalo/adapter.ts +++ b/src/channels/zalo/adapter.ts @@ -159,6 +159,19 @@ export class ZaloAdapter implements ChannelAdapter { } finally { await rm(tempDir, { recursive: true, force: true }); } + + if (message.attachments && message.attachments.length > 0) { + for (const attachment of message.attachments) { + if (attachment.url) { + const line = attachment.filename ? `${attachment.filename}: ${attachment.url}` : attachment.url; + await this.sendText(peerId, line); + continue; + } + if (attachment.data) { + console.warn(`Zalo: skipping attachment data (${attachment.mimeType}) — upload not implemented`); + } + } + } } async handleRequest(req: IncomingMessage, res: ServerResponse): Promise {