Skip to content

[NOWEB] Expose group member-share-history-mode (WhatsApp 'Group Message History' permission) as a settable endpoint #2282

Description

@alisonmwhite

What: A group-settings endpoint to set who can send message history to new members (WhatsApp's 2026 "Group Message History" permission), matching the existing settings pattern:

PUT /api/{session}/groups/{id}/settings/security/member-share-history-mode with { "membersCanShareHistory": true | false }.

Why: WhatsApp's Group Message History lets a member share recent messages (up to 100 / 14 days) with someone they add. A group-level permission decides who may do that: all members (ALL_MEMBER_SHARE) or admins only (ADMIN_SHARE). Groups created through the API keep the default, and automated group-provisioning flows currently have to toggle it by hand in the app on the owner's phone. It's the same gap member-add-mode had before #2165 / #2172.

How WhatsApp Web sets it: it's not a w:g2 settings IQ like member-add-mode. It's a MEX (GraphQL) mutation, WAWebMexUpdateGroupPropertyJobMutation (query_id 9418211574894172), with variables {"group_id": "<jid>@g.us", "update": {"member_share_group_history_mode": "ALL_MEMBER_SHARE" | "ADMIN_SHARE"}}. Success is data.xwa2_group_update_property.state === "ACTIVE". Reference: whatsapp-rust wacore/src/iq/mex_operations.rs (update_group_property) and src/features/groups.rs (set_member_share_history_mode).

Feasibility (NOWEB): the bundled Baileys fork already ships the generic MEX sender: lib/Socket/mex.js executeWMexQuery(variables, queryId, dataPath, query, generateMessageTag), which builds exactly WhatsApp Web's <iq xmlns="w:mex" type="get"> stanza. So it's a thin wrapper.

Tested: NOWEB on 2026.8.2 + this patch, against a real WhatsApp account:

  • as group admin: 200 {"id":"…@g.us","state":"ACTIVE"}, and the group shows WhatsApp's notice "changed this group's settings to allow all members to send message history to new members"
  • as non-admin: 500 GraphQL server error: Forbidden (WhatsApp enforces admin)

PR incoming.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions