@@ -80,38 +80,39 @@ func (cli *Client) handlePairDevice(ctx context.Context, node *waBinary.Node) {
8080}
8181
8282func (cli * Client ) getQRClientType () PairClientType {
83- if cli .QRClientType == PairClientUnknown {
84- switch store .DeviceProps .GetPlatformType () {
85- case waCompanionReg .DeviceProps_CHROME :
86- return PairClientChrome
87- case waCompanionReg .DeviceProps_FIREFOX :
88- return PairClientFirefox
89- case waCompanionReg .DeviceProps_EDGE :
90- return PairClientEdge
91- case waCompanionReg .DeviceProps_IE :
92- return PairClientIE
93- case waCompanionReg .DeviceProps_OPERA :
94- return PairClientOpera
95- case waCompanionReg .DeviceProps_SAFARI :
96- return PairClientSafari
97- case waCompanionReg .DeviceProps_UWP :
98- return PairClientUWP
99- default :
100- if store .BaseClientPayload .WebInfo != nil &&
101- store .BaseClientPayload .WebInfo .WebSubPlatform != nil &&
102- store .BaseClientPayload .WebInfo .GetWebSubPlatform () == waWa6 .ClientPayload_WebInfo_WEB_BROWSER {
103- return PairClientOtherWebClient
104- }
83+ if cli .QRClientType != "" {
84+ return cli .QRClientType
85+ }
86+ switch store .DeviceProps .GetPlatformType () {
87+ case waCompanionReg .DeviceProps_CHROME :
88+ return PairClientChrome
89+ case waCompanionReg .DeviceProps_FIREFOX :
90+ return PairClientFirefox
91+ case waCompanionReg .DeviceProps_EDGE :
92+ return PairClientEdge
93+ case waCompanionReg .DeviceProps_IE :
94+ return PairClientIE
95+ case waCompanionReg .DeviceProps_OPERA :
96+ return PairClientOpera
97+ case waCompanionReg .DeviceProps_SAFARI :
98+ return PairClientSafari
99+ case waCompanionReg .DeviceProps_UWP :
100+ return PairClientUWP
101+ case waCompanionReg .DeviceProps_ANDROID_PHONE :
102+ return PairClientAndroid
103+ default :
104+ if store .BaseClientPayload .UserAgent .GetPlatform () == waWa6 .ClientPayload_UserAgent_WEB {
105+ return PairClientOtherWebClient
105106 }
107+ return PairClientUnknown
106108 }
107- return cli .QRClientType
108109}
109110
110111func (cli * Client ) makeQRData (ref []byte , clientType PairClientType ) string {
111112 noise := base64 .StdEncoding .EncodeToString (cli .Store .NoiseKey .Pub [:])
112113 identity := base64 .StdEncoding .EncodeToString (cli .Store .IdentityKey .Pub [:])
113114 adv := base64 .StdEncoding .EncodeToString (cli .Store .AdvSecretKey )
114- return fmt .Sprintf ("https://wa.me/settings/linked_devices#%s,%s,%s,%s,%d " , ref , noise , identity , adv , clientType )
115+ return fmt .Sprintf ("https://wa.me/settings/linked_devices#%s,%s,%s,%s,%s " , ref , noise , identity , adv , clientType )
115116}
116117
117118func (cli * Client ) handlePairSuccess (ctx context.Context , node * waBinary.Node ) {
0 commit comments