Fix roundtripping of voice notes with body
This commit is contained in:
parent
c9c3d24fd9
commit
0b5f0df1ca
2 changed files with 50 additions and 14 deletions
|
|
@ -355,6 +355,39 @@ describe('backup/attachments', () => {
|
|||
{ backupLevel: BackupLevel.Paid }
|
||||
);
|
||||
});
|
||||
it('drops voice message flag when body is present', async () => {
|
||||
const attachment = composeAttachment(1);
|
||||
attachment.contentType = AUDIO_MP3;
|
||||
attachment.flags = SignalService.AttachmentPointer.Flags.VOICE_MESSAGE;
|
||||
|
||||
strictAssert(isVoiceMessage(attachment), 'it is a voice attachment');
|
||||
strictAssert(attachment.digest, 'digest exists');
|
||||
|
||||
await asymmetricRoundtripHarness(
|
||||
[
|
||||
composeMessage(1, {
|
||||
body: 'hello',
|
||||
attachments: [attachment],
|
||||
}),
|
||||
],
|
||||
[
|
||||
composeMessage(1, {
|
||||
body: 'hello',
|
||||
hasAttachments: true,
|
||||
attachments: [
|
||||
{
|
||||
...omit(attachment, NON_ROUNDTRIPPED_BACKUP_LOCATOR_FIELDS),
|
||||
flags: undefined,
|
||||
backupLocator: {
|
||||
mediaName: digestToMediaName(attachment.digest),
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
{ backupLevel: BackupLevel.Paid }
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Preview attachments', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue