mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
socket: potential fixes to the 66 id issues
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"version": [2, 3000, 1017531287]
|
"version": [2, 3000, 1019707846]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ export const DEFAULT_CONNECTION_CONFIG: SocketConfig = {
|
|||||||
patch: false,
|
patch: false,
|
||||||
snapshot: false,
|
snapshot: false,
|
||||||
},
|
},
|
||||||
|
countryCode: 'US',
|
||||||
getMessage: async() => undefined,
|
getMessage: async() => undefined,
|
||||||
cachedGroupMetadata: async() => undefined,
|
cachedGroupMetadata: async() => undefined,
|
||||||
makeSignalRepository: makeLibSignalRepository
|
makeSignalRepository: makeLibSignalRepository
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ export type SocketConfig = {
|
|||||||
transactionOpts: TransactionCapabilityOptions
|
transactionOpts: TransactionCapabilityOptions
|
||||||
/** marks the client as online whenever the socket successfully connects */
|
/** marks the client as online whenever the socket successfully connects */
|
||||||
markOnlineOnConnect: boolean
|
markOnlineOnConnect: boolean
|
||||||
|
/** alphanumeric country code (USA -> US) for the number used */
|
||||||
|
countryCode: string
|
||||||
/** provide a cache to store media, so does not have to be re-uploaded */
|
/** provide a cache to store media, so does not have to be re-uploaded */
|
||||||
mediaCache?: CacheStore
|
mediaCache?: CacheStore
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import { encodeBigEndian } from './generics'
|
|||||||
import { createSignalIdentity } from './signal'
|
import { createSignalIdentity } from './signal'
|
||||||
|
|
||||||
const getUserAgent = (config: SocketConfig): proto.ClientPayload.IUserAgent => {
|
const getUserAgent = (config: SocketConfig): proto.ClientPayload.IUserAgent => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
appVersion: {
|
appVersion: {
|
||||||
primary: config.version[0],
|
primary: config.version[0],
|
||||||
@@ -22,7 +21,9 @@ const getUserAgent = (config: SocketConfig): proto.ClientPayload.IUserAgent => {
|
|||||||
device: 'Desktop',
|
device: 'Desktop',
|
||||||
osBuildNumber: '0.1',
|
osBuildNumber: '0.1',
|
||||||
localeLanguageIso6391: 'en',
|
localeLanguageIso6391: 'en',
|
||||||
localeCountryIso31661Alpha2: 'US'
|
mnc: '000',
|
||||||
|
mcc: '000',
|
||||||
|
localeCountryIso31661Alpha2: config.countryCode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +59,8 @@ export const generateLoginNode = (userJid: string, config: SocketConfig): proto.
|
|||||||
const { user, device } = jidDecode(userJid)!
|
const { user, device } = jidDecode(userJid)!
|
||||||
const payload: proto.IClientPayload = {
|
const payload: proto.IClientPayload = {
|
||||||
...getClientPayload(config),
|
...getClientPayload(config),
|
||||||
passive: true,
|
passive: false,
|
||||||
|
pull: true,
|
||||||
username: +user,
|
username: +user,
|
||||||
device: device,
|
device: device,
|
||||||
}
|
}
|
||||||
@@ -91,6 +93,7 @@ export const generateRegistrationNode = (
|
|||||||
const registerPayload: proto.IClientPayload = {
|
const registerPayload: proto.IClientPayload = {
|
||||||
...getClientPayload(config),
|
...getClientPayload(config),
|
||||||
passive: false,
|
passive: false,
|
||||||
|
pull: false,
|
||||||
devicePairingData: {
|
devicePairingData: {
|
||||||
buildHash: appVersionBuf,
|
buildHash: appVersionBuf,
|
||||||
deviceProps: companionProto,
|
deviceProps: companionProto,
|
||||||
|
|||||||
Reference in New Issue
Block a user