mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2026-03-21 20:18:40 -06:00
Merge pull request #2332 from joinads/main
Evolution API - Multi-Device Fix
This commit is contained in:
@@ -67,7 +67,6 @@ import {
|
|||||||
Chatwoot,
|
Chatwoot,
|
||||||
ConfigService,
|
ConfigService,
|
||||||
configService,
|
configService,
|
||||||
ConfigSessionPhone,
|
|
||||||
Database,
|
Database,
|
||||||
Log,
|
Log,
|
||||||
Openai,
|
Openai,
|
||||||
@@ -124,7 +123,6 @@ import makeWASocket, {
|
|||||||
Product,
|
Product,
|
||||||
proto,
|
proto,
|
||||||
UserFacingSocketConfig,
|
UserFacingSocketConfig,
|
||||||
WABrowserDescription,
|
|
||||||
WAMediaUpload,
|
WAMediaUpload,
|
||||||
WAMessage,
|
WAMessage,
|
||||||
WAMessageKey,
|
WAMessageKey,
|
||||||
@@ -143,7 +141,6 @@ import Long from 'long';
|
|||||||
import mimeTypes from 'mime-types';
|
import mimeTypes from 'mime-types';
|
||||||
import NodeCache from 'node-cache';
|
import NodeCache from 'node-cache';
|
||||||
import cron from 'node-cron';
|
import cron from 'node-cron';
|
||||||
import { release } from 'os';
|
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import P from 'pino';
|
import P from 'pino';
|
||||||
import qrcode, { QRCodeToDataURLOptions } from 'qrcode';
|
import qrcode, { QRCodeToDataURLOptions } from 'qrcode';
|
||||||
@@ -624,19 +621,9 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
private async createClient(number?: string): Promise<WASocket> {
|
private async createClient(number?: string): Promise<WASocket> {
|
||||||
this.instance.authState = await this.defineAuthState();
|
this.instance.authState = await this.defineAuthState();
|
||||||
|
|
||||||
const session = this.configService.get<ConfigSessionPhone>('CONFIG_SESSION_PHONE');
|
if (number) {
|
||||||
|
|
||||||
let browserOptions = {};
|
|
||||||
|
|
||||||
if (number || this.phoneNumber) {
|
|
||||||
this.phoneNumber = number;
|
this.phoneNumber = number;
|
||||||
|
|
||||||
this.logger.info(`Phone number: ${number}`);
|
this.logger.info(`Phone number: ${number}`);
|
||||||
} else {
|
|
||||||
const browser: WABrowserDescription = [session.CLIENT, session.NAME, release()];
|
|
||||||
browserOptions = { browser };
|
|
||||||
|
|
||||||
this.logger.info(`Browser: ${browser}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch latest WhatsApp Web version automatically
|
// Fetch latest WhatsApp Web version automatically
|
||||||
@@ -697,7 +684,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
msgRetryCounterCache: this.msgRetryCounterCache,
|
msgRetryCounterCache: this.msgRetryCounterCache,
|
||||||
generateHighQualityLinkPreview: true,
|
generateHighQualityLinkPreview: true,
|
||||||
getMessage: async (key) => (await this.getMessage(key)) as Promise<proto.IMessage>,
|
getMessage: async (key) => (await this.getMessage(key)) as Promise<proto.IMessage>,
|
||||||
...browserOptions,
|
// Removido browserOptions para usar Multi-Device nativo (não WebClient)
|
||||||
markOnlineOnConnect: this.localSettings.alwaysOnline,
|
markOnlineOnConnect: this.localSettings.alwaysOnline,
|
||||||
retryRequestDelayMs: 350,
|
retryRequestDelayMs: 350,
|
||||||
maxMsgRetryCount: 4,
|
maxMsgRetryCount: 4,
|
||||||
|
|||||||
Reference in New Issue
Block a user