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 propsForGroupUpdateMessage = this.getPropsForGroupUpdateMessage();
const propsForTimerNotification = this.getPropsForTimerNotification(); const propsForTimerNotification = this.getPropsForTimerNotification();
const propsForMessageRequestResponse = this.getPropsForMessageRequestResponse(); const propsForMessageRequestResponse = this.getPropsForMessageRequestResponse();
const propsForQuote = this.getPropsForQuote();
const callNotificationType = this.get('callNotificationType'); const callNotificationType = this.get('callNotificationType');
const messageProps: MessageModelPropsWithoutConvoProps = { const messageProps: MessageModelPropsWithoutConvoProps = {
propsForMessage: this.getPropsForMessage(), propsForMessage: this.getPropsForMessage(),
@ -162,6 +163,9 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
if (propsForTimerNotification) { if (propsForTimerNotification) {
messageProps.propsForTimerNotification = propsForTimerNotification; messageProps.propsForTimerNotification = propsForTimerNotification;
} }
if (propsForQuote) {
messageProps.propsForQuote = propsForQuote;
}
if (callNotificationType) { if (callNotificationType) {
messageProps.propsForCallNotification = { messageProps.propsForCallNotification = {

@ -33,6 +33,7 @@ export type MessageModelPropsWithoutConvoProps = {
propsForGroupUpdateMessage?: PropsForGroupUpdate; propsForGroupUpdateMessage?: PropsForGroupUpdate;
propsForCallNotification?: PropsForCallNotification; propsForCallNotification?: PropsForCallNotification;
propsForMessageRequestResponse?: PropsForMessageRequestResponse; propsForMessageRequestResponse?: PropsForMessageRequestResponse;
propsForQuote?: PropsForQuote;
}; };
export type MessageModelPropsWithConvoProps = SortedMessageModelProps & { export type MessageModelPropsWithConvoProps = SortedMessageModelProps & {
@ -163,6 +164,17 @@ export type PropsForAttachment = {
} | null; } | null;
}; };
export type PropsForQuote = {
text?: string;
attachment?: QuotedAttachmentType;
isFromMe?: boolean;
sender: string;
authorProfileName?: string;
authorName?: string;
messageId?: string;
referencedMessageNotFound?: boolean;
};
export type PropsForMessageWithoutConvoProps = { export type PropsForMessageWithoutConvoProps = {
id: string; // messageId id: string; // messageId
direction: MessageModelType; direction: MessageModelType;
@ -179,16 +191,7 @@ export type PropsForMessageWithoutConvoProps = {
reacts?: ReactionList; reacts?: ReactionList;
reactsIndex?: number; reactsIndex?: number;
previews?: Array<any>; previews?: Array<any>;
quote?: { quote?: PropsForQuote;
text?: string;
attachment?: QuotedAttachmentType;
isFromMe?: boolean;
sender: string;
authorProfileName?: string;
authorName?: string;
messageId?: string;
referencedMessageNotFound?: boolean;
} | null;
messageHash?: string; messageHash?: string;
isDeleted?: boolean; isDeleted?: boolean;
isUnread?: 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 }; return { messagesProps, quotesProps };
} }

Loading…
Cancel
Save