Commit 8e5093c
authored
fix: respect caller-provided waveform for PTT audio messages (#2443)
* fix: respect caller-provided waveform for PTT audio messages
When a caller explicitly passes a `waveform` in the message options,
Baileys was unconditionally overwriting it with the result of
`getAudioWaveform()`. If `audio-decode` is not installed (it is an
optional peer dependency), `getAudioWaveform()` silently returns
`undefined`, discarding the caller's value and causing WhatsApp to
render a flat-line waveform.
Fix: only invoke `getAudioWaveform()` when no waveform has been
provided by the caller (`!uploadData.waveform`).
* refactor: move waveform guard to flag definition, use typeof check
* fix: lint1 parent 802d5f6 commit 8e5093c
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
| 227 | + | |
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
| |||
0 commit comments