Skip to content

Add Feature LabelMember#2164

Closed
FgsiDev wants to merge 14 commits into
WhiskeySockets:masterfrom
FgsiDev:feature/addlabelmember
Closed

Add Feature LabelMember#2164
FgsiDev wants to merge 14 commits into
WhiskeySockets:masterfrom
FgsiDev:feature/addlabelmember

Conversation

@FgsiDev

@FgsiDev FgsiDev commented Dec 10, 2025

Copy link
Copy Markdown

Preview image

@whiskeysockets-bot

whiskeysockets-bot commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

Thanks for opening this pull request and contributing to the project!

The next step is for the maintainers to review your changes. If everything looks good, it will be approved and merged into the main branch.

In the meantime, anyone in the community is encouraged to test this pull request and provide feedback.

✅ How to confirm it works

If you’ve tested this PR, please comment below with:

Tested and working ✅

This helps us speed up the review and merge process.

📦 To test this PR locally:

# NPM
npm install @whiskeysockets/baileys@FgsiDev/Baileys-1#feature/addlabelmember

# Yarn (v2+)
yarn add @whiskeysockets/baileys@FgsiDev/Baileys-1#feature/addlabelmember

# PNPM
pnpm add @whiskeysockets/baileys@FgsiDev/Baileys-1#feature/addlabelmember

If you encounter any issues or have feedback, feel free to comment as well.

@vanSnowi

Copy link
Copy Markdown

Good work but i recommend to add the additional nodes cause i got banned one time without them. Here my version:

const groupSetMemberLabel = async (jid: string, memberLabel: string) => {
    const result = await relayMessage(jid, {
        protocolMessage: {
	        type: 30,
	        memberLabel: {
	            label: memberLabel.slice(0, 30), //Limited to 30 chars
	            labelTimestamp: unixTimestampSeconds()
	        }
        }
    },{
	    additionalNodes: [{
	        tag: "meta",
	        attrs: {
	            tag_reason: "user_update",
                appdata: "member_tag"
	        },
	        content: undefined
	    }]
    })
    return result
}

@FgsiDev

FgsiDev commented Dec 11, 2025

Copy link
Copy Markdown
Author

Good work but i recommend to add the additional nodes cause i got banned one time without them. Here my version:

const groupSetMemberLabel = async (jid: string, memberLabel: string) => {
    const result = await relayMessage(jid, {
        protocolMessage: {
	        type: 30,
	        memberLabel: {
	            label: memberLabel.slice(0, 30), //Limited to 30 chars
	            labelTimestamp: unixTimestampSeconds()
	        }
        }
    },{
	    additionalNodes: [{
	        tag: "meta",
	        attrs: {
	            tag_reason: "user_update",
                appdata: "member_tag"
	        },
	        content: undefined
	    }]
    })
    return result
}

Wow, I just found out about that, maybe it could be a feature later.

@Santosl2

Copy link
Copy Markdown
Contributor

Whatsapp business?

Comment thread src/Socket/chats.ts Outdated
Comment thread src/Socket/chats.ts Outdated
Comment thread src/Socket/chats.ts
Comment thread src/Socket/chats.ts Outdated
@purpshell

purpshell commented Dec 12, 2025

Copy link
Copy Markdown
Member

Whatsapp business?

no this is a new feature in select places in the world with groups. You can label yourself to other participants if I understand it correctly

@Riders004

Copy link
Copy Markdown

Good work but i recommend to add the additional nodes cause i got banned one time without them. Here my version:

const groupSetMemberLabel = async (jid: string, memberLabel: string) => {
    const result = await relayMessage(jid, {
        protocolMessage: {
	        type: 30,
	        memberLabel: {
	            label: memberLabel.slice(0, 30), //Limited to 30 chars
	            labelTimestamp: unixTimestampSeconds()
	        }
        }
    },{
	    additionalNodes: [{
	        tag: "meta",
	        attrs: {
	            tag_reason: "user_update",
                appdata: "member_tag"
	        },
	        content: undefined
	    }]
    })
    return result
}

Jid means group jid ?

@FgsiDev
FgsiDev requested a review from purpshell December 13, 2025 12:30
@Salientekill

Copy link
Copy Markdown

Could you give an example of how to use it? I'm going to implement a system using this since my bot is focused on groups.

@Salientekill

Copy link
Copy Markdown

@FgsiDev Why are you meddling in various things that are not related to PR?

@FgsiDev FgsiDev closed this Dec 14, 2025
@purpshell

Copy link
Copy Markdown
Member

@FgsiDev Why are you meddling in various things that are not related to PR?

looks like he updated the version and also merged the sticker pack

@Salientekill

Copy link
Copy Markdown

@FgsiDev Why are you meddling in various things that are not related to PR?

looks like he updated the version and also merged the sticker pack

That's what I noticed, I was confused by the changes hahaha

@Salientekill

Copy link
Copy Markdown

@FgsiDev Can we reopen the PR with this feature?

purpshell pushed a commit that referenced this pull request Dec 19, 2025
* fix: improve message resend logic by adding checks for message IDs

* Revert "fix: improve message resend logic by adding checks for message IDs"

This reverts commit c03f9d8.

* feat: add group member label update functionality and event emission

* feat: refactor updateMemberLabel function for improved readability

* feat: use optional chaining for label association message in processMessage

* feat: add updateMemberLabel to makeMessagesSocket for enhanced functionality

* fix: correct log message for group member tag update event

Co-authored-by: FgsiDev
gusquadri pushed a commit to Simplify-Solucoes/Baileys that referenced this pull request Dec 23, 2025
…s#2198)

* fix: improve message resend logic by adding checks for message IDs

* Revert "fix: improve message resend logic by adding checks for message IDs"

This reverts commit c03f9d8.

* feat: add group member label update functionality and event emission

* feat: refactor updateMemberLabel function for improved readability

* feat: use optional chaining for label association message in processMessage

* feat: add updateMemberLabel to makeMessagesSocket for enhanced functionality

* fix: correct log message for group member tag update event

Co-authored-by: FgsiDev
GabrielHdez10 pushed a commit to GabrielHdez10/SOCKET-PARA-WHATSAPP that referenced this pull request Jan 5, 2026
…s#2198)

* fix: improve message resend logic by adding checks for message IDs

* Revert "fix: improve message resend logic by adding checks for message IDs"

This reverts commit c03f9d8.

* feat: add group member label update functionality and event emission

* feat: refactor updateMemberLabel function for improved readability

* feat: use optional chaining for label association message in processMessage

* feat: add updateMemberLabel to makeMessagesSocket for enhanced functionality

* fix: correct log message for group member tag update event

Co-authored-by: FgsiDev
purpshell added a commit that referenced this pull request Feb 24, 2026
* Add Feature LabelMember (Based on #2164) (#2198)

* fix: improve message resend logic by adding checks for message IDs

* Revert "fix: improve message resend logic by adding checks for message IDs"

This reverts commit c03f9d8.

* feat: add group member label update functionality and event emission

* feat: refactor updateMemberLabel function for improved readability

* feat: use optional chaining for label association message in processMessage

* feat: add updateMemberLabel to makeMessagesSocket for enhanced functionality

* fix: correct log message for group member tag update event

Co-authored-by: FgsiDev

* feat: Verify leaf signature (#2208)

* Update WA_CERT_DETAILS with issuer and public key

* certificate validation

* fix:lint

* padding

* lint: fix tab

---------

Co-authored-by: skidy89 <[email protected]>

* implement message reporting tokens (#1906)

* feat: implement message reporting tokens and privacy token handling

* feat: add support for privacy tokens in profile picture requests and history sync

* chore: pr feedback purpshell

* fix: improve privacy token handling and error messaging in socket configuration

* feat: enhance privacy token handling with improved sender mapping

* chore: removing tc token in favor of #2080

* chore: revert some unecessary changes

* feat(reporting): enhance reporting token extraction and compilation logic

* feat(reporting): add unit tests for reporting token utilities

* fix(reporting): streamline reporting token attachment logic in message sending

* fix: adjust reporting token inclusion logic to prevent retries

* chore: add return type to shouldIncludeReportingToken and improve getToken function type safety

* fix: getmessagetype to ensure consistency with whatsapp behavior (#2245)

* fix: avoid variable shadowing and preserve empty business profile fields (#2183)

* Update business.ts

* chore: fix lint issues

* feat: add support for FB and Interop JID encoding/decoding and empty strings (#2189)

* fix(messages): handle encryption failures per recipient and fail when all fail (#2226)

* fix(WAProto): Handle string values in long fields during JSON serialization (#1991)

* feat: add patch-tojson functionality for improved proto serialization

* Remove patch-tojson functionality and its import from the main index file to streamline the codebase.

* refactor: simplify longToString and longToNumber functions for better readability and performance

* feat: implement automated WhatsApp version update workflow and related scripts (#2130)

* feat: implement automated WhatsApp version update workflow and related scripts

* change cron to weekly

---------

Co-authored-by: Rajeh Taher <[email protected]>

* feat: send tctoken to profile update and presence subscribe (#2257)

* fix: improve message resend logic by adding checks for message IDs

* Revert "fix: improve message resend logic by adding checks for message IDs"

This reverts commit c03f9d8.

* feat(tc-token): implement buildTcTokenFromJid utility and integrate into chats socket

* fix(tc-token): ensure consistent return value when tcTokenBuffer is absent

* fix(chats): update import path for buildTcTokenFromJid utility

* moved retryCount before validating the session (#2167)

* fix(messages): enhance nullish value checks in message content generation (#2180)

* Feat improve testing coverage e2e (#1799)

* fix: ensure proper socket closure and await connection termination in tests

* feat(tests): enhance E2E tests for image and video message handling, including downloads and group interactions

* chore: lint+bugfix

* messages-recv: decrease PDO response timeout

* gitignore: fix ignoring logs coming from example file

* messages-send: revamp message type function

* process-message: remove timeout before event emit

* Fix critical memory leak in event buffer (#2160)

* fix(proto-extract): regenerate corrupted yarn.lock to restore install process (#1981)

* fix(proto-extract): regenerate corrupted yarn.lock to restore install process

* chore(proto-extract): update acorn parser to latest version for compatibility with new WhatsApp JS syntax

* Update baileys version to 2.3000.1029027441

* Update version number in Defaults index

* Revert WAProto.proto to resolve merge conflict and restore expected structure

---------

Co-authored-by: Vrypt <[email protected]>
Co-authored-by: Rajeh Taher <[email protected]>

* connection-deadlock, socket: improve socket end conditions

* chore: lint

* example: improve ping-pong

* example: customizable socket URL

* example: revamp example and add options for unit tests

* chore: update WhatsApp Web version (#2269)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: resolve race condition in decodeFrame handling and improve encryption integrity (#2182)

* fix: resolve race condition in decodeFrame handling and improve encryption integrity

* chore: pr feedback

* chore: Add messageTimestamp to message updates in messages-recv when receiving a message status update (#2277)

* fix: extract LID-PN mappings from history sync phoneNumberToLidMappings (#2268)

* fix: store LID-PN mapping from contactAction sync (#2266)

* fix: store LID-PN mapping from contactAction sync

* chore: improve testing of sync actions

* Add groupStatusMessage checks in message handling (#2258)

* Cache the children after a getBinaryNodeChild/ren call to avoid traversing arrays (#2093)

* generic-utils: cache the get

* generic-utils: increased type safety

* chore: lint

* fix(utils.normalizeMessageContent): add associatedChildMessage as one of the options to normalize (#1874)

Co-authored-by: Rajeh Taher <[email protected]>

* chore(tests): lint

* chat-utils,sync-action-utils: provide alternatives for the contact name

* example: revamp logging for example

* defaults, index: change shouldSyncHistoryMessage behavior

* history: fortify contact data

* history: add proper logging support in history

* example: cleanup

* socket: no sync warning!!!!!

* Fix connection showing "Online" but disconnected (#2132) (#2264)

* fix(messages): handle identity change notifications correctly (#2132)

* fix: tests and linting, add a helper like waweb

* fix: skip retry for expired status messages over 24 hours old (#2280)

* fix: optimize getLIDsForPNs and add getPNsForLIDs (#2274)

* fix: optimize lid-mapping and add getpnsforlids

* fix: lint

* fix: reintroduce store and fix partial returns

* fix: lint

* fix: extract LID-PN mappings from conversation objects in history sync (#2282)

* fix: extract LID-PN mappings from conversation objects in history sync

* fix: extract PN from userReceipt when pnJid is missing for LID chats

* feat: send unified session (#2294)

* fix: improve message resend logic by adding checks for message IDs

* Revert "fix: improve message resend logic by adding checks for message IDs"

This reverts commit c03f9d8.

* feat: add unified session handling and time constants

* refactor: improve socket variable destructuring and presence update logic

* fix: remove unnecessary semicolons in socket and time constants definitions

* fix: handle invalid server time offset parsing in makeSocket function

* fix: align noise-handler buffer types for Baileys build (#2284)

* fix: align noise-handler buffer types for Baileys build

* Align noise handler buffer types

* Clarify noise handler buffer typing

* perf: reduce DB calls during sync with caching and batching (#2316)

* perf: reduce DB calls during sync with caching and batching

* refactor: clean up comments and improve LID-PN mapping storage during history sync

* feat: replace async crypto with sync Rust WASM for app state sync (#2315)

* feat: replace async crypto with sync Rust WASM for app state sync

* fix: remove unecessary buffer copying

* fix: update whatsapp-rust-bridge to version 0.5.2 and refactor async calls to sync. HKDF and MD5 in rust

* fix: detect identity key changes and reset sessions (align with WA Web) (#2307)

* feat(signal): add RetryReason enum and MAC error-based session recreation

* feat(signal): add identity change detection with automatic session clearing

* fix(signal): integrate identity change detection with pkmsg decryption

This completes the identity change detection implementation by actually
calling saveIdentity() during pkmsg decryption, which is CRITICAL for
the feature to work.

Changes:
- Add extractIdentityFromPkmsg() function that parses PreKeyWhisperMessage
  protobuf to extract sender's identity key (33 bytes)
- Call saveIdentity() BEFORE decryption in decryptMessage() for pkmsg type
- Log when identity change is detected

Flow:
1. Receive pkmsg from sender
2. Extract identity key from PreKeyWhisperMessage protobuf
3. Call storage.saveIdentity() which compares with stored key
4. If key changed → session is cleared atomically
5. Decryption proceeds with re-established session

This matches WhatsApp Web's behavior where extractIdentityKey is called
before handleNewSession (GysEGRAXCvh.js:40917, 48815).

Ref: WhatsApp Web's extractIdentityKey (GysEGRAXCvh.js:48976-48998)

* chore: update WhatsApp Web version (#2330)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat(call): add caller phone number to offer call event (#2190)

* fix: request placeholder resend for messages without encryption (CTWAads) (#2334)

* fix: request placeholder resend for messages without encryption (CTWA ads)

* fix: implement placeholder resend cache management and metadata preservation

---------

Co-authored-by: Matheus Filype <[email protected]>
Co-authored-by: Skid <[email protected]>
Co-authored-by: skidy89 <[email protected]>
Co-authored-by: João Lucas de Oliveira Lopes <[email protected]>
Co-authored-by: Gustavo Quadri <[email protected]>
Co-authored-by: Ibrahim Pelumi Lasisi <[email protected]>
Co-authored-by: vini <[email protected]>
Co-authored-by: YonkoSam <[email protected]>
Co-authored-by: Vrypt <[email protected]>
Co-authored-by: Vrypt <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Luiz Braga <[email protected]>
Co-authored-by: David ??? <[email protected]>
Co-authored-by: Enzo Nascimento <[email protected]>
Co-authored-by: Ahmed Alwahib <[email protected]>
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.

8 participants