chore(rebase): realign duplicate backend/channel/schema files with main
This commit is contained in:
@@ -169,19 +169,6 @@ 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> {
|
||||
|
||||
@@ -388,27 +388,3 @@ function sanitizeFilename(filename?: string): string {
|
||||
function escapeRegex(value: string): string {
|
||||
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
}
|
||||
|
||||
function sanitizeFilename(name?: string): string {
|
||||
if (!name) {
|
||||
return '';
|
||||
}
|
||||
return name.replace(/[^a-zA-Z0-9._-]/g, '_').slice(0, 100);
|
||||
}
|
||||
|
||||
function extensionFromMimeType(mimeType?: string): string {
|
||||
if (!mimeType) {
|
||||
return '';
|
||||
}
|
||||
const simple = mimeType.split('/')[1]?.trim().toLowerCase();
|
||||
if (!simple) {
|
||||
return '';
|
||||
}
|
||||
if (simple.includes('jpeg')) {
|
||||
return '.jpg';
|
||||
}
|
||||
if (simple.includes('plain')) {
|
||||
return '.txt';
|
||||
}
|
||||
return `.${simple.replace(/[^a-z0-9]/g, '')}`;
|
||||
}
|
||||
|
||||
@@ -159,19 +159,6 @@ 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