fix(tctoken): add carousel exception to AB prop 10518 gate
Defensive: if WhatsApp ever flips AB prop 10518
(privacy_token_sending_on_all_1_on_1_messages) to false, the gate added
in 225b692b7c would drop the tctoken from ALL 1:1 sends — including
carousel, which Pastorini CDP capture confirms requires tctoken to
render correctly on Android.
Match the fork's pre-PR #2339 behaviour for carousel only: always
attach when a tcTokenBuffer is available. Regular 1:1 sends still
honour the AB prop.
This commit is contained in:
@@ -1731,7 +1731,13 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
// Gate inclusion on AB prop 10518 (privacy_token_sending_on_all_1_on_1_messages).
|
||||
// WA Web defaults to true; if the server flips it off we mirror that to avoid
|
||||
// divergence with the spec-compliant client.
|
||||
if (tcTokenBuffer?.length && sock.serverProps.privacyTokenOn1to1) {
|
||||
//
|
||||
// CARROUSEL EXCEPTION: Pastorini-validated carousel stanzas REQUIRE tctoken
|
||||
// (CDP capture confirms it). If the AB prop ever flips off, dropping the
|
||||
// tctoken from carousel would break rendering on Android. Carousel always
|
||||
// includes the tctoken when one is available, regardless of the prop —
|
||||
// matching the fork's existing behaviour pre-PR #2339.
|
||||
if (tcTokenBuffer?.length && (sock.serverProps.privacyTokenOn1to1 || isCarousel)) {
|
||||
;(stanza.content as BinaryNode[]).push({
|
||||
tag: 'tctoken',
|
||||
attrs: {},
|
||||
|
||||
Reference in New Issue
Block a user