@pst4r8/baileys2024
Advanced tools
Comparing version 7.6.3 to 7.6.4
@@ -18,3 +18,3 @@ "use strict"; | ||
const manufacturer = config.mobile ? 'Apple' : ''; | ||
const platform = config.mobile ? WAProto_1.proto.ClientPayload.UserAgent.Platform.IOS : WAProto_1.proto.ClientPayload.UserAgent.Platform.MACOS; | ||
const platform = config.mobile ? WAProto_1.proto.ClientPayload.UserAgent.Platform.IOS : WAProto_1.proto.ClientPayload.UserAgent.Platform.WEB; | ||
const phoneId = config.mobile ? { phoneId: config.auth.creds.phoneId } : {}; | ||
@@ -40,2 +40,13 @@ return { | ||
}; | ||
const PLATFORM_MAP = { | ||
'Mac OS': WAProto_1.proto.ClientPayload.WebInfo.WebSubPlatform.DARWIN, | ||
'Windows': WAProto_1.proto.ClientPayload.WebInfo.WebSubPlatform.WIN32 | ||
}; | ||
const getWebInfo = (config) => { | ||
let webSubPlatform = WAProto_1.proto.ClientPayload.WebInfo.WebSubPlatform.WEB_BROWSER; | ||
if (config.syncFullHistory && PLATFORM_MAP[config.browser[0]]) { | ||
webSubPlatform = PLATFORM_MAP[config.browser[0]]; | ||
} | ||
return { webSubPlatform }; | ||
}; | ||
const getClientPayload = (config) => { | ||
@@ -47,2 +58,5 @@ const payload = { | ||
}; | ||
if (!config.mobile) { | ||
payload.webInfo = getWebInfo(config); | ||
} | ||
return payload; | ||
@@ -49,0 +63,0 @@ }; |
{ | ||
"name": "@pst4r8/baileys2024", | ||
"version": "7.6.3", | ||
"version": "7.6.4", | ||
"description": "WhatsApp API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
7680550
47489
148