Support additional sticker states
Co-authored-by: scott@signal.org Co-authored-by: ken@signal.org
This commit is contained in:
parent
41880cfe66
commit
be5d0837f8
35 changed files with 925 additions and 249 deletions
|
@ -9,6 +9,7 @@ const { map, isArrayBuffer, isString } = require('lodash');
|
|||
|
||||
const PATH = 'attachments.noindex';
|
||||
const STICKER_PATH = 'stickers.noindex';
|
||||
const TEMP_PATH = 'temp';
|
||||
|
||||
exports.getAllAttachments = async userDataPath => {
|
||||
const dir = exports.getPath(userDataPath);
|
||||
|
@ -42,6 +43,20 @@ exports.getStickersPath = userDataPath => {
|
|||
return path.join(userDataPath, STICKER_PATH);
|
||||
};
|
||||
|
||||
// getTempPath :: AbsolutePath -> AbsolutePath
|
||||
exports.getTempPath = userDataPath => {
|
||||
if (!isString(userDataPath)) {
|
||||
throw new TypeError("'userDataPath' must be a string");
|
||||
}
|
||||
return path.join(userDataPath, TEMP_PATH);
|
||||
};
|
||||
|
||||
// clearTempPath :: AbsolutePath -> AbsolutePath
|
||||
exports.clearTempPath = userDataPath => {
|
||||
const tempPath = exports.getTempPath(userDataPath);
|
||||
return fse.emptyDir(tempPath);
|
||||
};
|
||||
|
||||
// createReader :: AttachmentsPath ->
|
||||
// RelativePath ->
|
||||
// IO (Promise ArrayBuffer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue