Message schema 6: Change classification of media and documents
For an easier implementation, we change our original definition of `initializeAttachmentMetadata`. This means we have to re-run it marked as version 6 and mark schema version 5 as deprecated as its definition has changed.
This commit is contained in:
parent
f4a5bc9907
commit
16bc1d34c6
4 changed files with 120 additions and 15 deletions
|
@ -2,6 +2,7 @@ const { assert } = require('chai');
|
|||
const sinon = require('sinon');
|
||||
|
||||
const Message = require('../../../js/modules/types/message');
|
||||
const { SignalService } = require('../../../ts/protobuf');
|
||||
const {
|
||||
stringToArrayBuffer,
|
||||
} = require('../../../js/modules/string_to_array_buffer');
|
||||
|
@ -242,7 +243,8 @@ describe('Message', () => {
|
|||
const input = {
|
||||
attachments: [
|
||||
{
|
||||
contentType: 'application/json',
|
||||
contentType: 'audio/aac',
|
||||
flags: SignalService.AttachmentPointer.Flags.VOICE_MESSAGE,
|
||||
data: stringToArrayBuffer('It’s easy if you try'),
|
||||
fileName: 'test\u202Dfig.exe',
|
||||
size: 1111,
|
||||
|
@ -253,7 +255,8 @@ describe('Message', () => {
|
|||
const expected = {
|
||||
attachments: [
|
||||
{
|
||||
contentType: 'application/json',
|
||||
contentType: 'audio/aac',
|
||||
flags: 1,
|
||||
path: 'abc/abcdefg',
|
||||
fileName: 'test\uFFFDfig.exe',
|
||||
size: 1111,
|
||||
|
@ -261,7 +264,7 @@ describe('Message', () => {
|
|||
],
|
||||
hasAttachments: 1,
|
||||
hasVisualMediaAttachments: undefined,
|
||||
hasFileAttachments: 1,
|
||||
hasFileAttachments: undefined,
|
||||
schemaVersion: Message.CURRENT_SCHEMA_VERSION,
|
||||
contact: [],
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue