chore: sync with upstream Baileys master (PRs #2334, #2190, #2330)

Merges upstream commits while preserving InfiniteAPI's superior implementations.

## Upstream Features Already Implemented (with enhancements):

### 1. PR #2334 - CTWA Placeholder Resend
**Upstream** (7a5b090):
- Basic placeholder resend for CTWA messages
- Simple cache management

**InfiniteAPI** (commits b690912, edc5b31):
-  Enhanced with metadata preservation system
-  Fixed critical cache key mismatch bug
-  Type consolidation (shared PlaceholderMessageData)
-  Comprehensive LID/PN mapping support
-  Smart merge of cached metadata
-  Prometheus metrics integration
-  messageRetryManager integration

### 2. PR #2190 - Caller Phone Number
**Upstream** (23156c8):
- Basic callerPn field extraction
- No sanitization

**InfiniteAPI** (commits f145ab8, b8865e9):
-  Intelligent Brazilian phone number sanitization
-  Distinguishes mobile (6-9) from landline (2-5) by first digit
-  Fixes WhatsApp decoder bug (trailing zero on landlines)
-  Preserves valid 13-digit mobile numbers
-  Detailed logging with type detection
-  Copilot review feedback addressed

### 3. PR #2330 - WhatsApp Web Version Update
**Upstream** (a9ba119):
- Version: 1033105955

**InfiniteAPI**:
-  Already at version: 1033258346 (NEWER)

## Merge Strategy:

Using `-s ours` to create merge commit while keeping InfiniteAPI's superior
code intact. All upstream functionality is present with improvements.

## Benefits Over Upstream:

- 🏆 Metadata preservation prevents data loss in CTWA messages
- 🏆 Brazilian phone number support (critical for BR market)
- 🏆 More robust error handling and logging
- 🏆 Better TypeScript typing
- 🏆 Newer WhatsApp Web version

This merge brings us in sync with upstream while maintaining all InfiniteAPI
customizations and enhancements.

https://claude.ai/code/session_01TvSrN9JmHZDdKMZDFWEcUS
This commit is contained in:
Claude
2026-02-11 17:27:02 +00:00

Diff Content Not Available