Skip to content

Feat/whatsapp privacy tab - #487

Merged
gustavo-barrios2006 merged 5 commits into
gabrielhhaber:mainfrom
reffehcsoibaf:feat/whatsapp-privacy-tab
Oct 13, 2026
Merged

gustavo-barrios2006 merged 5 commits into
gabrielhhaber:mainfrom
reffehcsoibaf:feat/whatsapp-privacy-tab

Conversation

@reffehcsoibaf

Copy link
Copy Markdown
Contributor

Traz do fork a aba Privacidade da conta do WhatsApp, do jeito que ela funciona lá hoje, mais a privacidade do Status, possível aqui porque o WinZapp já sincroniza os contatos.

O que muda para o usuário
Arquivo > Configurações do WhatsApp abre uma janela com as configurações guardadas na própria conta pareada. A aba Privacidade lê e aplica direto no WhatsApp:

  • Visto por último, Online, Recado, Foto do perfil, Confirmação de leitura, Quem pode me adicionar a grupos
  • Quem pode ver meus status: Meus contatos / Meus contatos, exceto... / Compartilhar somente com... — as pessoas vêm dos contatos sincronizados, numa lista de caixas de verificação com busca (ListCtrl com caixas; Espaço e Enter marcam)

Só as opções alteradas são enviadas. Cada gravação é relida, e o que o WhatsApp não confirmar é dito pelo nome. Na lista do Status, cada pessoa vai pelo @lid quando ele é conhecido (o WhatsApp ignora sem erro um número @c.us em contas endereçadas por LID), e a lista relida é comparada pessoa a pessoa.

Como foi feito

  • client/api_patches: privacyController.ts + util/privacyRuntime.ts criam /privacy, /privacy/set e /privacy/status (o WPPConnect Server não expõe WPP.privacy). Os valores são validados antes de chegar à página, e o texto de erro nativo nunca sai dela.
  • A leitura cai para getUserPrivacySettings() quando WPP.privacy.get() falha na versão atual do WhatsApp Web (wa-js#3693, ainda não lançado), sem precisar fixar o wa-js.
  • Regras puras em core/whatsapp_privacy.py (incluindo a seleção de pessoas), chamadas ao servidor no WhatsAppPrivacyMixin; testes para tudo isso e para o controller/runtime.
  • Textos e entrada no changelog em todos os idiomas.

A aba Perfil fica de fora, porque o WinZapp já tem uma. A parte do Status ainda não foi testada com conta real: vale conferir no celular se "Meus contatos, exceto..." realmente esconde o status da pessoa escolhida.

reffehcsoibaf and others added 4 commits October 13, 2026 17:31
File > WhatsApp settings opens a window for settings kept on the paired
WhatsApp account. Its Privacy tab reads and applies, directly on WhatsApp:
last seen, online, About, profile photo, read receipts, who can add me to
groups, and who can see my Status (my contacts / my contacts except... /
only share with...), with the people picked from the synchronised contacts
in a searchable check list.

- api_patches: privacyController.ts + util/privacyRuntime.ts add
  /privacy, /privacy/set and /privacy/status (WPP.privacy, not wrapped by
  WPPConnect Server). Values are validated before reaching the page;
  native error text never leaves it (it can carry numbers and names).
- Reading falls back to getUserPrivacySettings() when WPP.privacy.get()
  throws on the current WhatsApp Web build (wa-js#3693, unreleased).
- Only changed settings are sent; every write is read back and anything
  WhatsApp does not confirm is named.
- Pure rules in core/whatsapp_privacy.py, server calls in the
  WhatsAppPrivacyMixin; tests for both and for the controller/runtime.
- Strings and changelog entry in every locale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WVPbir4p7TQ4HLQMoQgQ54
…back

Review follow-ups for the WhatsApp settings Privacy tab:

- The Status contact picker is a ListCtrl with checkboxes (not a
  CheckListBox, whose checked state NVDA does not expose); Space and Enter
  toggle. Who is ticked lives in core.whatsapp_privacy.AudienceSelection,
  tested directly: filtering never adds or drops a person.
- People go on the Status list by their @lid when the bridge knows one
  (both Brazilian 8/9-digit forms), the phone form only otherwise.
- After applying, the list is read back and compared person by person
  (contact_dedup_key); anything WhatsApp did not keep is reported as not
  confirmed instead of "updated".
- A row for someone outside the synced contacts shows a name or phone
  number, never an @lid's digits.
- The notes after loading (or "Privacy settings loaded.") and the audience
  count after the picker closes are spoken.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WVPbir4p7TQ4HLQMoQgQ54
- privacyRuntime.ts: type annotations so `tsc` (strict) compiles it.
  `npm run build` runs tsc before babel, so setup_api.py failed and every
  build that compiles the API (macOS CI, the Windows release and alpha
  pipelines, a developer's setup-api) broke. Babel erases the
  annotations: the function serialised into the page is unchanged.
- Status picker: a person on WhatsApp's list who is not a synchronised
  contact is looked up by the normalised JID (WhatsApp reports @c.us, the
  contacts are keyed by @s.whatsapp.net) and, for an @lid, by its bridged
  phone, so a known name is shown instead of "Not in your contacts".
- What an Apply confirmed is now core.whatsapp_privacy.apply_outcome(),
  tested directly; the dialog only applies it.
- The text an error box shows is no longer spoken just before it, which
  NVDA cut off at once when reading the box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WmFGjY3WDiwbRjXL6zhiyY
_outside_contact_label now goes through _get_contact_tolerant (which
bridges the Brazilian 8/9-digit forms), tries the phone before the @lid
as _resolve_contact_name does, and takes the first form that carries a
name, so a nameless @lid record no longer hides the phone entry's name.
The runtime's header says only erasable type annotations are allowed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WmFGjY3WDiwbRjXL6zhiyY
# Conflicts:
#	client/changelog_en-US.txt
#	client/changelog_es-ES.txt
#	client/changelog_pl.txt
#	client/changelog_pt-BR.txt
#	client/changelog_pt-PT.txt
#	client/changelog_ro.txt
#	client/changelog_tr-TR.txt
@gustavo-barrios2006
gustavo-barrios2006 merged commit f4540c1 into gabrielhhaber:main Oct 13, 2026
4 checks passed
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.

3 participants