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

feat: add Id support for desktop #1240

Merged
merged 3 commits into from
Feb 24, 2025
Merged

Conversation

AstroX11
Copy link
Contributor

@AstroX11 AstroX11 commented Feb 4, 2025

This commit adjusts the ID length check for desktop, fixing the issue where some desktop IDs were incorrectly classified as "unknown."

Baileys stopped identifying if a message was from WA Desktop (Based on my observations last Year).

This adjustment addresses this issue.

Usage:

import { getDevice } from 'baileys'

console.log(getDevice('3FBBHEUFEUVUF783B839FB8F3')) // Test

Result:

desktop

This commit adjusts the ID length check for desktop, fixing the issue where some desktop IDs were incorrectly classified as "unknown."

Baileys stopped identifying if a message was from WA Desktop (Based on my observations last Year).

This adjustment addresses this issue.
@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@AstroX11/Baileys#master
# YARN v2
yarn add @whiskeysockets/baileys@AstroX11/Baileys#master

@bobslavtriev
Copy link
Contributor

Instead of using /^3F/.test(id) ? 'desktop' : /^.{18}$/.test(id) ? 'desktop'

Better to use: /^(3F|.{18}$)/.test(id) ? 'desktop'

  • Few codes
  • Multiple checks

@AstroX11
Copy link
Contributor Author

AstroX11 commented Feb 5, 2025

okay

@AstroX11
Copy link
Contributor Author

AstroX11 commented Feb 5, 2025

Instead of using /^3F/.test(id) ? 'desktop' : /^.{18}$/.test(id) ? 'desktop'

Better to use: /^(3F|.{18}$)/.test(id) ? 'desktop'

  • Few codes
  • Multiple checks

Done

@AstroX11
Copy link
Contributor Author

AstroX11 commented Feb 5, 2025

@purpshell please check this

@AstroX11
Copy link
Contributor Author

AstroX11 commented Feb 10, 2025

fixed linting @purpshell

@AstroX11 AstroX11 requested a review from purpshell February 10, 2025 19:31
@purpshell purpshell merged commit 89b28a4 into WhiskeySockets:master Feb 24, 2025
2 checks passed
@purpshell purpshell added this to the 6.7.14 milestone Feb 24, 2025
Mellosre added a commit to Mellosre/Baileys12 that referenced this pull request Mar 1, 2025
feat: add Id support for desktop (WhiskeySockets#1240)
* feat: add Id support for desktop

This commit adjusts the ID length check for desktop, fixing the issue where some desktop IDs were incorrectly classified as "unknown."

Baileys stopped identifying if a message was from WA Desktop (Based on my observations last Year).

This adjustment addresses this issue.

* redundancy removed

* fix: linting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants