fix(baileys): extract location and history content from ephemeral-wrapped messages#596
Merged
Merged
Conversation
…ed messages - Read inbound location coordinates off the normalized (unwrapped) content instead of the raw message, so an ephemeral/disappearing-chat location no longer drops its coordinates. - Normalize history-sync messages before mapping: unwrap ephemeral/viewOnce/documentWithCaption/edited wrappers so a disappearing-chat history message maps to its real type and body via extractBaileysBody, instead of type 'unknown' with an empty body. captureHistoryMessages now loads the lib once and passes it down.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two Baileys inbound-extraction gaps for ephemeral (disappearing-chat) and other wrapped messages.
Changes
content.locationMessageoff the raw message, but a disappearing-chat location nests under the wrapper, so the raw field was undefined and the coordinates were lost. It now reads off the normalized (unwrapped) content, matching how the media path already works.mapHistoryMessagetook the raw top-level key as the type and read the body off raw fields, so an ephemeral/viewOnce-wrapped history message mapped to typeunknownwith an empty body. It now normalizes the content first (unwrapping ephemeral/viewOnce/documentWithCaption/edited), derives one content type for both the skip-filter and the type mapping, and reusesextractBaileysBody— the same extraction the live path uses.captureHistoryMessagesloads the lib once and passes it down.Verification
npm run build✓ ·npm test✓ (1865/1865, +2) · lint ✓. New tests: an ephemeral location message surfaces its coordinates; an ephemeral-wrapped history message maps to its real type/body.