Refactor instance deletion logic and enhance WhatsApp connection updates

- Updated the `deleteInstance` method to allow logout for instances in 'connecting' or 'open' states, improving instance management.
- Enhanced the `BaileysStartupService` to include additional profile information (wuid, profileName, profilePictureUrl) in connection update webhooks.
- Removed redundant webhook data sending logic, streamlining connection state updates for better performance.
- Adjusted settings schema to ensure required fields are properly validated.
This commit is contained in:
Davidson Gomes
2025-01-17 17:54:18 -03:00
parent ac58f58bbc
commit cfe6bd9ae0
3 changed files with 26 additions and 28 deletions

View File

@@ -33,22 +33,6 @@ export const settingsSchema: JSONSchema7 = {
syncFullHistory: { type: 'boolean' },
wavoipToken: { type: 'string' },
},
required: [
'rejectCall',
'groupsIgnore',
'alwaysOnline',
'readMessages',
'readStatus',
'syncFullHistory',
'wavoipToken',
],
...isNotEmpty(
'rejectCall',
'groupsIgnore',
'alwaysOnline',
'readMessages',
'readStatus',
'syncFullHistory',
'wavoipToken',
),
required: ['rejectCall', 'groupsIgnore', 'alwaysOnline', 'readMessages', 'readStatus', 'syncFullHistory'],
...isNotEmpty('rejectCall', 'groupsIgnore', 'alwaysOnline', 'readMessages', 'readStatus', 'syncFullHistory'),
};