Voice notes mini-player

This commit is contained in:
Alvaro 2023-02-24 16:18:57 -07:00 committed by GitHub
parent b5849f872a
commit 0e655ceeed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 1599 additions and 487 deletions

View file

@ -163,7 +163,7 @@ export function hasErrors(
}
export function getSource(
message: MessageWithUIFieldsType,
message: Pick<MessageAttributesType, 'type' | 'source'>,
ourNumber: string | undefined
): string | undefined {
if (isIncoming(message)) {
@ -195,7 +195,7 @@ export function getSourceDevice(
}
export function getSourceUuid(
message: MessageWithUIFieldsType,
message: Pick<MessageAttributesType, 'type' | 'sourceUuid'>,
ourACI: string | undefined
): string | undefined {
if (isIncoming(message)) {
@ -1554,13 +1554,16 @@ export function getPropsForEmbeddedContact(
return embeddedContactSelector(firstContact, {
regionCode,
getAbsoluteAttachmentPath:
window.Signal.Migrations.getAbsoluteAttachmentPath,
getAbsoluteAttachmentPath: getAttachmentUrlForPath,
firstNumber,
uuid: accountSelector(firstNumber),
});
}
export function getAttachmentUrlForPath(path: string): string {
return window.Signal.Migrations.getAbsoluteAttachmentPath(path);
}
export function getPropsForAttachment(
attachment: AttachmentType
): AttachmentType | undefined {
@ -1575,23 +1578,17 @@ export function getPropsForAttachment(
fileSize: size ? filesize(size) : undefined,
isVoiceMessage: isVoiceMessage(attachment),
pending,
url: path
? window.Signal.Migrations.getAbsoluteAttachmentPath(path)
: undefined,
url: path ? getAttachmentUrlForPath(path) : undefined,
screenshot: screenshot?.path
? {
...screenshot,
url: window.Signal.Migrations.getAbsoluteAttachmentPath(
screenshot.path
),
url: getAttachmentUrlForPath(screenshot.path),
}
: undefined,
thumbnail: thumbnail?.path
? {
...thumbnail,
url: window.Signal.Migrations.getAbsoluteAttachmentPath(
thumbnail.path
),
url: getAttachmentUrlForPath(thumbnail.path),
}
: undefined,
};
@ -1602,9 +1599,7 @@ function processQuoteAttachment(
): QuotedAttachmentType {
const { thumbnail } = attachment;
const path =
thumbnail &&
thumbnail.path &&
window.Signal.Migrations.getAbsoluteAttachmentPath(thumbnail.path);
thumbnail && thumbnail.path && getAttachmentUrlForPath(thumbnail.path);
const objectUrl = thumbnail && thumbnail.objectUrl;
const thumbnailWithObjectUrl =