Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: find platform type based on browser second argument #485

Merged
merged 3 commits into from
Jan 2, 2024

Conversation

allburov
Copy link
Contributor

@allburov allburov commented Nov 5, 2023

fix #481 #228

If we use

browser: ['MyAwesomeApp', 'chrome', '22.5.0']

WhatsApp shows the browser's icon in Linked Devices
Screenshot_2023-11-05-19-05-01-396_com whatsapp (1)

@whiskeysockets-bot
Copy link
Contributor

Thanks for your contribution.

The next step is to wait for review and approval to merge it to main repository

The community can help reacting with a thumb up (:thumbsup:) for approval and rocket (:rocket:) for who has tested it.

To test this PR you can run the following command below:

# NPM
npm install @whiskeysockets/baileys@allburov/Baileys#get-browser-logo-back
# YARN v2
yarn add @whiskeysockets/baileys@allburov/Baileys#get-browser-logo-back

@FERDIZ-afk
Copy link

Can fi be used in the pairing code?

Copy link
Contributor

@azudindaem azudindaem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@allburov
Copy link
Contributor Author

allburov commented Nov 7, 2023

The linter goes crazy about not changed code, idk what to do here. Let me know if I need to adjust the code somehow!

Ismananda

This comment was marked as resolved.

@CSFelix
Copy link

CSFelix commented Nov 16, 2023

Great Job!!!! If it is possible, what do you think in adding two more browsers: Brave and Tor?

@Riders004
Copy link

Great Job!!!! If it is possible, what do you think in adding two more browsers: Brave and Tor?

Add. Firefox brave tor

@onurguven
Copy link

Lgtm

@allburov
Copy link
Contributor Author

Brave and Tor

Is there any values for this browsers in WhatsApp proto? I didn't see it in the list

enum PlatformType {
UNKNOWN = 0;
CHROME = 1;
FIREFOX = 2;
IE = 3;
OPERA = 4;
SAFARI = 5;
EDGE = 6;
DESKTOP = 7;
IPAD = 8;
ANDROID_TABLET = 9;
OHANA = 10;
ALOHA = 11;
CATALINA = 12;
TCL_TV = 13;
IOS_PHONE = 14;
IOS_CATALYST = 15;
ANDROID_PHONE = 16;
ANDROID_AMBIGUOUS = 17;
WEAR_OS = 18;
AR_WRIST = 19;
AR_DEVICE = 20;
UWP = 21;
VR = 22;
}

I'll change the solution as @Ismananda mentioned so we can define any values that available in proto!

@Riders004
Copy link

LGTM

What is LGTM

@Riders004
Copy link

Riders004 commented Nov 20, 2023

Can this Working For Also For QR Code ?

@allburov

@Riders004
Copy link

Pair code mode not working with recent change

@allburov
Copy link
Contributor Author

Pair code mode not working with recent change

Thank you for the information! To be honest, I haven't tested it :D

I've reverted the changes - we can process them later in the different PR and merge QR mode for now.

@allburov
Copy link
Contributor Author

What is LGTM

looks good to me

@Riders004
Copy link

Pair code mode not working with recent change

Thank you for the information! To be honest, I haven't tested it :D

I've reverted the changes - we can process them later in the different PR and merge QR mode for now.

I'm qr is working but in pair its say incorrect code what I do

@Riders004
Copy link

Riders004 commented Nov 20, 2023

@allburov This One Working On QR Code And Pair Code You Can Check Here And You Can Also Test It And You Can Make Pull Request

@adiwajshing @PurpShell @Auties00 @SheIITear @whiskeysockets-bot @FERDIZ-afk you can merge that request if @allburov he make it

@Ismananda
Copy link

I'm qr is working but in pair its say incorrect code what I do

Excuse me, I can see your socket configuration in the browser section
browser: ["device", "browser", "version"]

@Riders004
Copy link

I'm qr is working but in pair its say incorrect code what I do

Excuse me, I can see your socket configuration in the browser section browser: ["device", "browser", "version"]

IMG_20231122_214555

That's my Browser Configuration and I also added in my Baileys that i added in my pair code script folder

If you want browser version then you can find on google

@Ismananda
Copy link

I'm qr is working but in pair its say incorrect code what I do

Excuse me, I can see your socket configuration in the browser section browser: ["device", "browser", "version"]

IMG_20231122_214555

That's my Browser Configuration and I also added in my Baileys that i added in my pair code script folder

If you want browser version then you can find on google

I don't know for sure how it can be an error to you (because I actually don't really understand typescript)
But I use configuration like this browser: ["Mac OS", "Safari", clVer] and make an experiment by changing the code in node_modules/baileys as I said earlier and it work for me for qrcode and pairing code
So on the linked device you will see like this
IMG

@Ismananda
Copy link

So maybe it was unsuccessful because of the differences in the implementation of javascript with typescript or maybe other factors. Thank you for trying my advice and apologize for trouble

@jeankassio
Copy link

Tested today
image

Copy link
Collaborator

@PurpShell PurpShell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Collaborator

@SheIITear SheIITear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@PurpShell
Copy link
Collaborator

This is not for the pairing code, this is stupid and incorrect. the second argument is the one for the browser type not the first one. Just reverse

@PurpShell PurpShell closed this Jan 2, 2024
@PurpShell PurpShell reopened this Jan 2, 2024
@PurpShell PurpShell merged commit 2fd1635 into WhiskeySockets:master Jan 2, 2024
3 of 4 checks passed
@Salientekill
Copy link

fix #481 #228

If we use

browser: ['MyAwesomeApp', 'chrome', '22.5.0']

WhatsApp shows the browser's icon in Linked Devices Screenshot_2023-11-05-19-05-01-396_com whatsapp (1)

I tried using your example and it didn't work

@Riders004
Copy link

fix #481 #228
If we use

browser: ['MyAwesomeApp', 'chrome', '22.5.0']

WhatsApp shows the browser's icon in Linked Devices Screenshot_2023-11-05-19-05-01-396_com whatsapp (1)

I tried using your example and it didn't work

Upgrade Baileys

@Riders004
Copy link

This is not for the pairing code, this is stupid and incorrect. the second argument is the one for the browser type not the first one. Just reverse

I tried it's working for both pairing code and qr code

@Riders004
Copy link

I'm qr is working but in pair its say incorrect code what I do

Excuse me, I can see your socket configuration in the browser section browser: ["device", "browser", "version"]

IMG_20231122_214555
That's my Browser Configuration and I also added in my Baileys that i added in my pair code script folder
If you want browser version then you can find on google

I don't know for sure how it can be an error to you (because I actually don't really understand typescript) But I use configuration like this browser: ["Mac OS", "Safari", clVer] and make an experiment by changing the code in node_modules/baileys as I said earlier and it work for me for qrcode and pairing code So on the linked device you will see like this IMG

That browser Config I use that for pairing code you can use in qr code

@Salientekill
Copy link

fix #481 #228
If we use

browser: ['MyAwesomeApp', 'chrome', '22.5.0']

WhatsApp shows the browser's icon in Linked Devices Screenshot_2023-11-05-19-05-01-396_com whatsapp (1)

I tried using your example and it didn't work

Upgrade Baileys

I already updated, but it still doesn't work:

browser: ['MyAwesomeApp', 'chrome', '22.5.0']

@SheIITear
Copy link
Collaborator

Do not fill this pr with unrelated comments. If you need help ask on the offtopic channel on the discord server.

@Salientekill
Copy link

Do not fill this pr with unrelated comments. If you need help ask on the offtopic channel on the discord server.

But it's related to this pr, I tried using the same way as the examples and it didn't work

@SheIITear
Copy link
Collaborator

Do not fill this pr with unrelated comments. If you need help ask on the offtopic channel on the discord server.

But it's related to this pr, I tried using the same way as the examples and it didn't work

Still this is not the place to ask for help. Locking this pr, you can continue the conversation on the server.

@WhiskeySockets WhiskeySockets locked and limited conversation to collaborators Jan 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Browser