fix(channels): handle LINE and Zalo outbound attachment references

This commit is contained in:
William Valentin
2026-02-16 23:45:21 -08:00
parent 21a7a18008
commit 9fbd866435
2 changed files with 26 additions and 0 deletions
+13
View File
@@ -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<void> {
+13
View File
@@ -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<void> {