feat: added propsForQuote to message model props

pull/2757/head
William Grant 2 years ago
parent 331a4e1e12
commit ab1cf7a658

@ -143,6 +143,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
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<MessageAttributes> {
if (propsForTimerNotification) {
messageProps.propsForTimerNotification = propsForTimerNotification;
}
if (propsForQuote) {
messageProps.propsForQuote = propsForQuote;
}
if (callNotificationType) {
messageProps.propsForCallNotification = {

@ -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<any>;
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 };
}

Loading…
Cancel
Save