Normalize message attachments

This commit is contained in:
trevor-signal
2025-05-22 21:09:54 -04:00
committed by GitHub
parent 8d8e0329cf
commit d6e81eee11
39 changed files with 2540 additions and 807 deletions

View File

@@ -4,7 +4,6 @@
import type { DurationInSeconds } from '../util/durations';
import type { AttachmentType } from './Attachment';
import type { EmbeddedContactType } from './EmbeddedContact';
import type { IndexableBoolean, IndexablePresence } from './IndexedDB';
export function getMentionsRegex(): RegExp {
return /\uFFFC/g;
@@ -34,7 +33,6 @@ export type IncomingMessage = Readonly<
source?: string;
sourceDevice?: number;
} & SharedMessageProperties &
MessageSchemaVersion5 &
MessageSchemaVersion6 &
ExpirationTimerUpdate
>;
@@ -56,7 +54,6 @@ export type OutgoingMessage = Readonly<
isViewOnce?: number;
synced: boolean;
} & SharedMessageProperties &
MessageSchemaVersion5 &
ExpirationTimerUpdate
>;
@@ -64,7 +61,6 @@ export type VerifiedChangeMessage = Readonly<
{
type: 'verified-change';
} & SharedMessageProperties &
MessageSchemaVersion5 &
ExpirationTimerUpdate
>;
@@ -72,7 +68,6 @@ export type ProfileChangeNotificationMessage = Readonly<
{
type: 'profile-change';
} & SharedMessageProperties &
MessageSchemaVersion5 &
ExpirationTimerUpdate
>;
@@ -92,14 +87,6 @@ export type ExpirationTimerUpdate = Partial<
}>
>;
export type MessageSchemaVersion5 = Partial<
Readonly<{
hasAttachments: IndexableBoolean;
hasVisualMediaAttachments: IndexablePresence;
hasFileAttachments: IndexablePresence;
}>
>;
export type MessageSchemaVersion6 = Partial<
Readonly<{
contact: Array<EmbeddedContactType>;