Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
048c5dc2ec | ||
|
|
eb218da8fb | ||
|
|
65942a4ed4 | ||
|
|
1444155c09 |
No files matched your search
@@ -172,7 +172,9 @@ export abstract class WhatsappSession {
|
||||
'--disable-accelerated-2d-canvas',
|
||||
'--disable-application-cache',
|
||||
'--disable-background-networking',
|
||||
'--disable-software-rasterizer',
|
||||
// DO NOT disable software rasterizer, it will break the video
|
||||
// https://github.com/devlikeapro/waha/issues/629
|
||||
// '--disable-software-rasterizer',
|
||||
'--disable-cache',
|
||||
'--disable-client-side-phishing-detection',
|
||||
'--disable-component-update',
|
||||
|
||||
@@ -621,6 +621,7 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
const message = {
|
||||
text: request.text,
|
||||
mentions: request.mentions?.map(toJID),
|
||||
linkPreview: this.getLinkPreview(request),
|
||||
};
|
||||
const options = await this.getMessageOptions(request);
|
||||
return this.sock.sendMessage(chatId, message, options);
|
||||
@@ -1686,6 +1687,22 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
quoted: quoted,
|
||||
};
|
||||
}
|
||||
|
||||
protected getLinkPreview(request): any {
|
||||
// NOWEB works this way
|
||||
// If it's undefined - it'll generate it
|
||||
// If it's false - it will not generate it
|
||||
let linkPreview: boolean | undefined;
|
||||
switch (request.linkPreview) {
|
||||
case false:
|
||||
linkPreview = false;
|
||||
break;
|
||||
case true:
|
||||
default:
|
||||
linkPreview = undefined;
|
||||
}
|
||||
return linkPreview;
|
||||
}
|
||||
}
|
||||
|
||||
function hasPath(url: string) {
|
||||
|
||||
@@ -1169,6 +1169,7 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
return {
|
||||
mentions: mentions,
|
||||
quotedMessageId: quotedMessageId,
|
||||
linkPreview: request.linkPreview,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ export class LocalStoreCore extends LocalStore {
|
||||
const engineDir = this.getEngineDirectory();
|
||||
const database = path.join(engineDir, 'waha.sqlite3');
|
||||
this.db = new Database(database);
|
||||
this.db.pragma('journal_mode = WAL;');
|
||||
}
|
||||
return this.db;
|
||||
}
|
||||
|
||||
@@ -156,6 +156,8 @@ export class MessageTextRequest extends ChatRequest {
|
||||
|
||||
@ReplyToProperty()
|
||||
reply_to?: string;
|
||||
|
||||
linkPreview?: boolean = true;
|
||||
}
|
||||
|
||||
export class EditMessageRequest {
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ export function getEngineName(): string {
|
||||
}
|
||||
|
||||
export const VERSION: WAHAEnvironment = {
|
||||
version: '2024.11.2',
|
||||
version: '2024.11.3',
|
||||
engine: getEngineName(),
|
||||
tier: getWAHAVersion(),
|
||||
browser: getBrowserExecutablePath(),
|
||||
|
||||
Reference in new issue
Block a user