-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat: Switch between QR or phone number pairing method #3180
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
base: main
Are you sure you want to change the base?
Conversation
…app-web.js into webpack-exodus
…app-web.js into webpack-exodus
…ommit for some reason)
…app-web.js into webpack-exodus
…edroslopez#3001) * Change window.Store.ProfilePic.profilePicFind to window.Store.ProfilePic.requestProfilePicFromServer * Prevent breaking v2.2x * refactor: make it more readable --------- Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com>
f9f4cea
to
4531867
Compare
will this be pulled? i was about the req for the same feature |
UP! |
up pleas! |
up! |
will this ever be merged? :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make more sense to stick with the previous approach that used the hardcoded timeout callback.
I'm talking about reverting this commit c5d5e56
Yeah I agree, the latest code uses regex to read the js files which is quite unreadable. I'll revert it. |
This reverts commit c5d5e56.
PR Details
The ability to change the preferred login/authentication method either use QR code or pair with a phone number (Linked devices -> Link a device -> Link with phone number instead).
Description
pairWithPhoneNumber
which is an object containing the parameters forrequestPairingCode
function in Client.js. The attributes of this object are:phoneNumber
: Phone number in international, symbol-free format <COUNTRY_CODE><PHONE_NUMBER>showNotification
: Show notification to pair for the specified phone numberintervalMs
: The interval in milliseconds on how frequent to generate pairing code (WhatsApp default to 3 minutes)code
andwindow.onCodeReceivedEvent
event will run a callback once a code has been generated.The
inject
function in Client.js will check if thephoneNumber
option is set, and will switch to phone number pairing mode without running any QR related functions.intervalMs
is the time to wait for the next generation of code to mitigate the problem of expired code.Related Issues
closes ##3370 fixes #3371 fixes #3416
Motivation and Context
requestPairingCode
without having to manually utilize the functionHow Has This Been Tested
To run or test this feature, run
node app.js
where app.js contains the following code:The pairing code should be displayed to the terminal every 3 minutes (WhatsApp current default). Developer tools are used to inspect some variables while running in non-headless mode. So far, no issues have been encountered during testing on QR code functions or any other existing features.
Types of changes
Checklist