diff --git a/src/Defaults/index.ts b/src/Defaults/index.ts index 96ae82af..a18b6449 100644 --- a/src/Defaults/index.ts +++ b/src/Defaults/index.ts @@ -38,12 +38,14 @@ export const PROCESSABLE_HISTORY_TYPES = [ proto.Message.HistorySyncNotification.HistorySyncType.PUSH_NAME, proto.Message.HistorySyncNotification.HistorySyncType.RECENT, proto.Message.HistorySyncNotification.HistorySyncType.FULL, - proto.Message.HistorySyncNotification.HistorySyncType.ON_DEMAND + proto.Message.HistorySyncNotification.HistorySyncType.ON_DEMAND, + proto.Message.HistorySyncNotification.HistorySyncType.NON_BLOCKING_DATA, + proto.Message.HistorySyncNotification.HistorySyncType.INITIAL_STATUS_V3 ] export const DEFAULT_CONNECTION_CONFIG: SocketConfig = { version: version as WAVersion, - browser: Browsers.ubuntu('Chrome'), + browser: Browsers.macOS('Chrome'), waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat', connectTimeoutMs: 20_000, keepAliveIntervalMs: 30_000, @@ -70,7 +72,7 @@ export const DEFAULT_CONNECTION_CONFIG: SocketConfig = { patch: false, snapshot: false }, - countryCode: 'GB', + countryCode: 'US', getMessage: async () => undefined, cachedGroupMetadata: async () => undefined, makeSignalRepository: makeLibSignalRepository diff --git a/src/Socket/index.ts b/src/Socket/index.ts index 1006c43c..3ee2d850 100644 --- a/src/Socket/index.ts +++ b/src/Socket/index.ts @@ -11,6 +11,7 @@ const makeWASocket = (config: UserFacingSocketConfig) => { // If the user hasn't provided their own history sync function, // let's create a default one that respects the syncFullHistory flag. + // TODO: Change if (config.shouldSyncHistoryMessage === undefined) { newConfig.shouldSyncHistoryMessage = () => !!newConfig.syncFullHistory } diff --git a/src/Utils/validate-connection.ts b/src/Utils/validate-connection.ts index 51149fb4..f1cad608 100644 --- a/src/Utils/validate-connection.ts +++ b/src/Utils/validate-connection.ts @@ -26,6 +26,7 @@ const getUserAgent = (config: SocketConfig): proto.ClientPayload.IUserAgent => { device: 'Desktop', osBuildNumber: '0.1', localeLanguageIso6391: 'en', + mnc: '000', mcc: '000', localeCountryIso31661Alpha2: config.countryCode @@ -39,7 +40,7 @@ const PLATFORM_MAP = { const getWebInfo = (config: SocketConfig): proto.ClientPayload.IWebInfo => { let webSubPlatform = proto.ClientPayload.WebInfo.WebSubPlatform.WEB_BROWSER - if (config.syncFullHistory && PLATFORM_MAP[config.browser[0] as keyof typeof PLATFORM_MAP]) { + if (config.syncFullHistory && PLATFORM_MAP[config.browser[0] as keyof typeof PLATFORM_MAP] && config.browser[1] == 'Desktop') { webSubPlatform = PLATFORM_MAP[config.browser[0] as keyof typeof PLATFORM_MAP] } @@ -117,7 +118,7 @@ export const generateRegistrationNode = ( const registerPayload: proto.IClientPayload = { ...getClientPayload(config), - passive: true, + passive: false, pull: false, devicePairingData: { buildHash: appVersionBuf,