Refactor outbound delivery state

This commit is contained in:
Evan Hahn 2021-07-09 16:38:51 -05:00 committed by GitHub
parent 831ec98418
commit 9c48a95eb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 3200 additions and 697 deletions

15
ts/model-types.d.ts vendored
View file

@ -20,6 +20,10 @@ import { MessageModel } from './models/messages';
import { ConversationModel } from './models/conversations';
import { ProfileNameChangeType } from './util/getStringForProfileChange';
import { CapabilitiesType } from './textsecure/WebAPI';
import {
SendState,
SendStateByConversationId,
} from './messages/MessageSendState';
import { GroupNameCollisionsWithIdsByTitle } from './util/groupMemberNameCollisions';
import { ConversationColorType } from './types/Colors';
import { AttachmentType, ThumbnailType } from './types/Attachment';
@ -88,8 +92,6 @@ export type MessageAttributesType = {
decrypted_at?: number;
deletedForEveryone?: boolean;
deletedForEveryoneTimestamp?: number;
delivered?: number;
delivered_to?: Array<string | null>;
errors?: Array<CustomError>;
expirationStartTimestamp?: number | null;
expireTimer?: number;
@ -115,10 +117,8 @@ export type MessageAttributesType = {
targetTimestamp: number;
timestamp: number;
}>;
read_by?: Array<string | null>;
requiredProtocolVersion?: number;
retryOptions?: RetryOptions;
sent?: boolean;
sourceDevice?: string | number;
supportedVersionAtReceive?: unknown;
synced?: boolean;
@ -152,14 +152,10 @@ export type MessageAttributesType = {
data?: AttachmentType;
};
sent_at: number;
sent_to?: Array<string>;
unidentifiedDeliveries?: Array<string>;
contact?: Array<ContactType>;
conversationId: string;
recipients?: Array<string>;
reaction?: WhatIsThis;
destination?: WhatIsThis;
destinationUuid?: string;
expirationTimerUpdate?: {
expireTimer: number;
@ -192,6 +188,9 @@ export type MessageAttributesType = {
droppedGV2MemberIds?: Array<string>;
sendHQImages?: boolean;
// Should only be present for outgoing messages
sendStateByConversationId?: SendStateByConversationId;
};
export type ConversationAttributesTypeType = 'private' | 'group';