Fix global custom colored quote in composition area
This commit is contained in:
parent
53d6065c00
commit
cdf8b0b28d
1 changed files with 16 additions and 10 deletions
|
@ -29,7 +29,7 @@ import {
|
||||||
import { CallbackResultType } from '../textsecure/SendMessage';
|
import { CallbackResultType } from '../textsecure/SendMessage';
|
||||||
import * as expirationTimer from '../util/expirationTimer';
|
import * as expirationTimer from '../util/expirationTimer';
|
||||||
import { missingCaseError } from '../util/missingCaseError';
|
import { missingCaseError } from '../util/missingCaseError';
|
||||||
import { ConversationColorType } from '../types/Colors';
|
import { ConversationColors } from '../types/Colors';
|
||||||
import { CallMode } from '../types/Calling';
|
import { CallMode } from '../types/Calling';
|
||||||
import { BodyRangesType } from '../types/Util';
|
import { BodyRangesType } from '../types/Util';
|
||||||
import { ReactionType } from '../types/Reactions';
|
import { ReactionType } from '../types/Reactions';
|
||||||
|
@ -957,11 +957,6 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||||
.map(attachment => this.getPropsForAttachment(attachment));
|
.map(attachment => this.getPropsForAttachment(attachment));
|
||||||
}
|
}
|
||||||
|
|
||||||
getConversationColor(): ConversationColorType {
|
|
||||||
const conversation = this.getConversation();
|
|
||||||
return conversation?.getConversationColor() || ('ultramarine' as const);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Note: interactionMode is mixed in via selectors/conversations._messageSelector
|
// Note: interactionMode is mixed in via selectors/conversations._messageSelector
|
||||||
getPropsForMessage(): PropsForMessage {
|
getPropsForMessage(): PropsForMessage {
|
||||||
const sourceId = this.getContactId();
|
const sourceId = this.getContactId();
|
||||||
|
@ -996,13 +991,18 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||||
) || {}
|
) || {}
|
||||||
).emoji;
|
).emoji;
|
||||||
|
|
||||||
|
const { customColor = undefined } = conversation
|
||||||
|
? conversation.getCustomColorData()
|
||||||
|
: {};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
author: contact,
|
author: contact,
|
||||||
text: this.createNonBreakingLastSeparator(this.get('body')),
|
text: this.createNonBreakingLastSeparator(this.get('body')),
|
||||||
textPending: this.get('bodyPending'),
|
textPending: this.get('bodyPending'),
|
||||||
id: this.id,
|
id: this.id,
|
||||||
conversationColor: this.getConversationColor(),
|
conversationColor:
|
||||||
customColor: conversation?.getCustomColorData()?.customColor,
|
conversation?.getConversationColor() ?? ConversationColors[0],
|
||||||
|
customColor,
|
||||||
conversationId: this.get('conversationId'),
|
conversationId: this.get('conversationId'),
|
||||||
isSticker: Boolean(sticker),
|
isSticker: Boolean(sticker),
|
||||||
direction: this.isIncoming() ? 'incoming' : 'outgoing',
|
direction: this.isIncoming() ? 'incoming' : 'outgoing',
|
||||||
|
@ -1330,6 +1330,11 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||||
|
|
||||||
const firstAttachment = quote.attachments && quote.attachments[0];
|
const firstAttachment = quote.attachments && quote.attachments[0];
|
||||||
|
|
||||||
|
const conversation = this.getConversation();
|
||||||
|
const { customColor = undefined } = conversation
|
||||||
|
? conversation.getCustomColorData()
|
||||||
|
: {};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
authorId,
|
authorId,
|
||||||
authorName,
|
authorName,
|
||||||
|
@ -1337,8 +1342,9 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||||
authorProfileName,
|
authorProfileName,
|
||||||
authorTitle,
|
authorTitle,
|
||||||
bodyRanges: this.processBodyRanges(bodyRanges),
|
bodyRanges: this.processBodyRanges(bodyRanges),
|
||||||
conversationColor: this.getConversationColor(),
|
conversationColor:
|
||||||
customColor: this.getConversation()?.get('customColor'),
|
conversation?.getConversationColor() ?? ConversationColors[0],
|
||||||
|
customColor,
|
||||||
isFromMe,
|
isFromMe,
|
||||||
rawAttachment: firstAttachment
|
rawAttachment: firstAttachment
|
||||||
? this.processQuoteAttachment(firstAttachment)
|
? this.processQuoteAttachment(firstAttachment)
|
||||||
|
|
Loading…
Add table
Reference in a new issue