Skip to content

feat: support document MIME types (PDF, Office, etc) and set FileName on DocumentMessage - #342

Open
pokus32 wants to merge 1 commit into
lharries:mainfrom
pokus32:feature/document-mimetypes-and-filename
Open

feat: support document MIME types (PDF, Office, etc) and set FileName on DocumentMessage#342
pokus32 wants to merge 1 commit into
lharries:mainfrom
pokus32:feature/document-mimetypes-and-filename

Conversation

@pokus32

@pokus32 pokus32 commented Aug 27, 2026

Copy link
Copy Markdown

Summary of Changes

  1. Document MIME Type Mapping: Added explicit MIME type resolution for common document types (.pdf, .docx, .xlsx, .pptx, .txt, .csv, .zip) in sendWhatsAppMessage. Previously, all non-image/audio/video files defaulted to application/octet-stream.
  2. Proper FileName Protobuf Field: Set FileName: proto.String(fileName) on waProto.DocumentMessage. Without this field and valid MIME type, WhatsApp mobile/desktop clients render documents as raw binary (.bin) blobs without extension badges or file previews.
  3. LID & Chat Compatibility: Preserves all existing group and direct chat handling.

Tested sending PDF and office documents; now rendered correctly with PDF badge and inline viewer support.

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.

1 participant