diff --git a/ts/models/message.ts b/ts/models/message.ts index 15173a878..6fa9704c7 100644 --- a/ts/models/message.ts +++ b/ts/models/message.ts @@ -143,6 +143,7 @@ export class MessageModel extends Backbone.Model { const propsForGroupUpdateMessage = this.getPropsForGroupUpdateMessage(); const propsForTimerNotification = this.getPropsForTimerNotification(); const propsForMessageRequestResponse = this.getPropsForMessageRequestResponse(); + const propsForQuote = this.getPropsForQuote(); const callNotificationType = this.get('callNotificationType'); const messageProps: MessageModelPropsWithoutConvoProps = { propsForMessage: this.getPropsForMessage(), @@ -162,6 +163,9 @@ export class MessageModel extends Backbone.Model { if (propsForTimerNotification) { messageProps.propsForTimerNotification = propsForTimerNotification; } + if (propsForQuote) { + messageProps.propsForQuote = propsForQuote; + } if (callNotificationType) { messageProps.propsForCallNotification = { diff --git a/ts/state/ducks/conversations.ts b/ts/state/ducks/conversations.ts index ac6b73721..9c60f02d2 100644 --- a/ts/state/ducks/conversations.ts +++ b/ts/state/ducks/conversations.ts @@ -33,6 +33,7 @@ export type MessageModelPropsWithoutConvoProps = { propsForGroupUpdateMessage?: PropsForGroupUpdate; propsForCallNotification?: PropsForCallNotification; propsForMessageRequestResponse?: PropsForMessageRequestResponse; + propsForQuote?: PropsForQuote; }; export type MessageModelPropsWithConvoProps = SortedMessageModelProps & { @@ -163,6 +164,17 @@ export type PropsForAttachment = { } | null; }; +export type PropsForQuote = { + text?: string; + attachment?: QuotedAttachmentType; + isFromMe?: boolean; + sender: string; + authorProfileName?: string; + authorName?: string; + messageId?: string; + referencedMessageNotFound?: boolean; +}; + export type PropsForMessageWithoutConvoProps = { id: string; // messageId direction: MessageModelType; @@ -179,16 +191,7 @@ export type PropsForMessageWithoutConvoProps = { reacts?: ReactionList; reactsIndex?: number; previews?: Array; - quote?: { - text?: string; - attachment?: QuotedAttachmentType; - isFromMe?: boolean; - sender: string; - authorProfileName?: string; - authorName?: string; - messageId?: string; - referencedMessageNotFound?: boolean; - } | null; + quote?: PropsForQuote; messageHash?: string; isDeleted?: boolean; isUnread?: boolean; @@ -404,7 +407,7 @@ async function getMessages({ } } - window.log.debug(`WIP: quoteProps`, quotesProps); + window.log.debug(`WIP: duck quoteProps`, quotesProps); return { messagesProps, quotesProps }; }