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,
|
||||
ConfigService,
|
||||
configService,
|
||||
ConfigSessionPhone,
|
||||
Database,
|
||||
Log,
|
||||
Openai,
|
||||
@@ -124,7 +123,6 @@ import makeWASocket, {
|
||||
Product,
|
||||
proto,
|
||||
UserFacingSocketConfig,
|
||||
WABrowserDescription,
|
||||
WAMediaUpload,
|
||||
WAMessage,
|
||||
WAMessageKey,
|
||||
@@ -143,7 +141,6 @@ import Long from 'long';
|
||||
import mimeTypes from 'mime-types';
|
||||
import NodeCache from 'node-cache';
|
||||
import cron from 'node-cron';
|
||||
import { release } from 'os';
|
||||
import { join } from 'path';
|
||||
import P from 'pino';
|
||||
import qrcode, { QRCodeToDataURLOptions } from 'qrcode';
|
||||
@@ -624,19 +621,9 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
private async createClient(number?: string): Promise<WASocket> {
|
||||
this.instance.authState = await this.defineAuthState();
|
||||
|
||||
const session = this.configService.get<ConfigSessionPhone>('CONFIG_SESSION_PHONE');
|
||||
|
||||
let browserOptions = {};
|
||||
|
||||
if (number || this.phoneNumber) {
|
||||
if (number) {
|
||||
this.phoneNumber = 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
|
||||
@@ -697,7 +684,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
msgRetryCounterCache: this.msgRetryCounterCache,
|
||||
generateHighQualityLinkPreview: true,
|
||||
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,
|
||||
retryRequestDelayMs: 350,
|
||||
maxMsgRetryCount: 4,
|
||||
|
||||
Reference in New Issue
Block a user