New attachment storage system
This commit is contained in:
parent
273e1ccb15
commit
28664a606f
161 changed files with 2418 additions and 1562 deletions
|
@ -18,6 +18,7 @@ import * as log from '../logging/log';
|
|||
import { map, take, collect } from './iterables';
|
||||
import { strictAssert } from './assert';
|
||||
import { getMessageSentTimestamp } from './getMessageSentTimestamp';
|
||||
import { getLocalAttachmentUrl } from './getLocalAttachmentUrl';
|
||||
|
||||
export async function makeQuote(
|
||||
quotedMessage: MessageAttributesType
|
||||
|
@ -58,8 +59,7 @@ export async function getQuoteAttachment(
|
|||
preview?: Array<LinkPreviewType>,
|
||||
sticker?: StickerType
|
||||
): Promise<Array<QuotedAttachmentType>> {
|
||||
const { getAbsoluteAttachmentPath, loadAttachmentData } =
|
||||
window.Signal.Migrations;
|
||||
const { loadAttachmentData } = window.Signal.Migrations;
|
||||
|
||||
if (attachments && attachments.length) {
|
||||
const attachmentsToUse = Array.from(take(attachments, 1));
|
||||
|
@ -84,7 +84,7 @@ export async function getQuoteAttachment(
|
|||
? {
|
||||
...(await loadAttachmentData(thumbnail)),
|
||||
objectUrl: thumbnail.path
|
||||
? getAbsoluteAttachmentPath(thumbnail.path)
|
||||
? getLocalAttachmentUrl(thumbnail)
|
||||
: undefined,
|
||||
}
|
||||
: undefined,
|
||||
|
@ -107,7 +107,7 @@ export async function getQuoteAttachment(
|
|||
? {
|
||||
...(await loadAttachmentData(image)),
|
||||
objectUrl: image.path
|
||||
? getAbsoluteAttachmentPath(image.path)
|
||||
? getLocalAttachmentUrl(image)
|
||||
: undefined,
|
||||
}
|
||||
: undefined,
|
||||
|
@ -124,7 +124,7 @@ export async function getQuoteAttachment(
|
|||
contentType,
|
||||
thumbnail: {
|
||||
...(await loadAttachmentData(sticker.data)),
|
||||
objectUrl: path ? getAbsoluteAttachmentPath(path) : undefined,
|
||||
objectUrl: path ? getLocalAttachmentUrl(sticker.data) : undefined,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue