Skip to content

Commit

Permalink
[core] markOnline NOWEB
Browse files Browse the repository at this point in the history
fix #412
  • Loading branch information
devlikepro committed Sep 18, 2024
1 parent d7a699c commit 743e4f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/engines/noweb/session.noweb.core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -229,6 +233,7 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
getMessage: (key) => this.getMessage(key),
syncFullHistory: fullSyncEnabled,
msgRetryCounterCache: this.msgRetryCounterCache,
markOnlineOnConnect: markOnlineOnConnect,
};
}

Expand Down
6 changes: 6 additions & 0 deletions src/structures/sessions.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 743e4f3

Please sign in to comment.