Improve quoted attachment typings
This commit is contained in:
parent
38226115a4
commit
5f0080a7d7
20 changed files with 98 additions and 97 deletions
2
ts/textsecure/Types.d.ts
vendored
2
ts/textsecure/Types.d.ts
vendored
|
@ -132,7 +132,7 @@ export type ProcessedGroupV2Context = {
|
|||
};
|
||||
|
||||
export type ProcessedQuoteAttachment = {
|
||||
contentType?: string;
|
||||
contentType: MIMEType;
|
||||
fileName?: string;
|
||||
thumbnail?: ProcessedAttachment;
|
||||
};
|
||||
|
|
|
@ -142,7 +142,9 @@ export function processQuote(
|
|||
text: dropNull(quote.text),
|
||||
attachments: (quote.attachments ?? []).map(attachment => {
|
||||
return {
|
||||
contentType: dropNull(attachment.contentType),
|
||||
contentType: attachment.contentType
|
||||
? stringToMIMEType(attachment.contentType)
|
||||
: APPLICATION_OCTET_STREAM,
|
||||
fileName: dropNull(attachment.fileName),
|
||||
thumbnail: processAttachment(attachment.thumbnail),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue