fix(protocol): attach voice waveforms on outgoing records

Private-chat clients only draw the progress track from message metadata.
Compute amplitudes when uploading a record so PC and phone show the bar.
This commit is contained in:
DrSmoothl committed 2026-09-13 22:21:57 +08:00
1 parent 7ef256c487
commit 0a6c5b7d2a
6 files changed
+344 -1

No files matched your search

@@ -56,6 +56,14 @@ describe('ptt-upload', () => {
const c2cFlags = (args.extBizInfo as any).ptt.bytesGeneralFlags;
expect(c2cFlags.length).toBe(14);
expect(c2cFlags[0]).toBe(0x9a);
expect((args.extBizInfo as any).ptt.waveform).toBeUndefined();
});
it('fingerprint path does not invent a waveform', async () => {
await uploadPttMsgInfo({} as any, true, 12345, FINGERPRINT);
const args = vi.mocked(pipeline.runNtv2Upload).mock.calls[0]![0];
expect((args.extBizInfo as any).ptt.waveform).toBeUndefined();
expect(pipeline.finalizeMediaMsgInfo).toHaveBeenCalledOnce();
});
it('fingerprint payload: zero bytes, fastOnlyError ready, voiceFormat defaults to 1', async () => {