fix(channels): handle LINE and Zalo outbound attachment references
This commit is contained in:
@@ -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> {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user