Merge pull request #485 from allburov/get-browser-logo-back

fix: find platform type based on browser second argument
This commit is contained in:
Rajeh Taher
2024-01-02 03:55:01 +02:00
committed by GitHub

View File

@@ -79,6 +79,11 @@ export const generateLoginNode = (userJid: string, config: SocketConfig): proto.
return proto.ClientPayload.fromObject(payload)
}
const getPlatformType = (platform: string): proto.DeviceProps.PlatformType => {
const platformType = platform.toUpperCase()
return proto.DeviceProps.PlatformType[platformType] || proto.DeviceProps.PlatformType.DESKTOP
}
export const generateRegistrationNode = (
{ registrationId, signedPreKey, signedIdentityKey }: SignalCreds,
config: SocketConfig
@@ -91,7 +96,7 @@ export const generateRegistrationNode = (
const companion: proto.IDeviceProps = {
os: config.browser[0],
platformType: proto.DeviceProps.PlatformType.DESKTOP,
platformType: getPlatformType(config.browser[1]),
requireFullSync: config.syncFullHistory,
}
@@ -211,4 +216,4 @@ export const encodeSignedDeviceIdentity = (
return proto.ADVSignedDeviceIdentity
.encode(account)
.finish()
}
}