Harmonized filenames with Android version (#4324)

The Android app saves files with the filename format
'signal-YYYY-MM-DD-hhmmss.extension' but the desktop version
saves them with format 'signal-attachment-YYYY-MM-DD-hhmmss.extension'.
The attachment changes the suggested filename in Attachment.ts
to have the prefix 'signal' rather than 'signal-attachment'.
Tests were changed as necessary.

Resolves #4321
This commit is contained in:
Nat Talbot 2020-06-10 17:48:41 -04:00 committed by GitHub
parent 66aa6f142a
commit 7b5fe0cdbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -49,7 +49,7 @@ describe('Attachment', () => {
attachment,
timestamp,
});
const expected = 'signal-attachment-1970-01-01-000000.mov';
const expected = 'signal-1970-01-01-000000.mov';
assert.strictEqual(actual, expected);
});
});
@ -65,7 +65,7 @@ describe('Attachment', () => {
timestamp,
index: 3,
});
const expected = 'signal-attachment-1970-01-01-000000_003.mov';
const expected = 'signal-1970-01-01-000000_003.mov';
assert.strictEqual(actual, expected);
});
});

View file

@ -374,7 +374,7 @@ export const getSuggestedFilename = ({
return attachment.fileName;
}
const prefix = 'signal-attachment';
const prefix = 'signal';
const suffix = timestamp
? moment(timestamp).format('-YYYY-MM-DD-HHmmss')
: '';