diff --git a/src/core/engines/noweb/session.noweb.core.ts b/src/core/engines/noweb/session.noweb.core.ts index f4aff3c6..8fe9aced 100644 --- a/src/core/engines/noweb/session.noweb.core.ts +++ b/src/core/engines/noweb/session.noweb.core.ts @@ -212,6 +212,10 @@ export class WhatsappSessionNoWebCore extends WhatsappSession { const browser = fullSyncEnabled ? Browsers.ubuntu('Desktop') : Browsers.ubuntu('Chrome'); + let markOnlineOnConnect = this.sessionConfig?.noweb?.markOnline; + if (markOnlineOnConnect == undefined) { + markOnlineOnConnect = true; + } return { agent: agent, fetchAgent: agent, @@ -229,6 +233,7 @@ export class WhatsappSessionNoWebCore extends WhatsappSession { getMessage: (key) => this.getMessage(key), syncFullHistory: fullSyncEnabled, msgRetryCounterCache: this.msgRetryCounterCache, + markOnlineOnConnect: markOnlineOnConnect, }; } diff --git a/src/structures/sessions.dto.ts b/src/structures/sessions.dto.ts index 6c54832c..b8278319 100644 --- a/src/structures/sessions.dto.ts +++ b/src/structures/sessions.dto.ts @@ -80,6 +80,12 @@ export class NowebConfig { @Type(() => NowebStoreConfig) @IsOptional() store?: NowebStoreConfig; + + @ApiProperty({ + description: 'Mark the session as online when it connects to the server.', + }) + @IsBoolean() + markOnline: boolean = true; } export class SessionConfig {