From e78d1dfb87bf3ef2b9e199cc9141de4b8edeb700 Mon Sep 17 00:00:00 2001 From: William Grant Date: Mon, 1 May 2023 17:35:51 +1000 Subject: [PATCH] fix: send full text body for quote resolved regression with quote author name --- ts/components/conversation/SessionMessagesList.tsx | 2 ++ ts/components/conversation/composition/CompositionBox.tsx | 2 +- ts/models/conversation.ts | 7 ++----- ts/receiver/queuedJob.ts | 7 ++++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ts/components/conversation/SessionMessagesList.tsx b/ts/components/conversation/SessionMessagesList.tsx index 6feb5d4dd..064a833c3 100644 --- a/ts/components/conversation/SessionMessagesList.tsx +++ b/ts/components/conversation/SessionMessagesList.tsx @@ -155,6 +155,8 @@ export const SessionMessagesList = (props: { return [, ...componentToMerge]; } + // TODO Move Quote rendering logic here maybe? + if (!messageProps) { return null; } diff --git a/ts/components/conversation/composition/CompositionBox.tsx b/ts/components/conversation/composition/CompositionBox.tsx index 694cbe5fb..91373c867 100644 --- a/ts/components/conversation/composition/CompositionBox.tsx +++ b/ts/components/conversation/composition/CompositionBox.tsx @@ -60,7 +60,7 @@ import { FixedBaseEmoji } from '../../../types/Reaction'; export interface ReplyingToMessageProps { convoId: string; - id: string; + id: string; // this is the message timestamp author: string; timestamp: number; text?: string; diff --git a/ts/models/conversation.ts b/ts/models/conversation.ts index aeda1410f..a6f058892 100644 --- a/ts/models/conversation.ts +++ b/ts/models/conversation.ts @@ -518,14 +518,11 @@ export class ConversationModel extends Backbone.Model { } } - const { title, isMe } = quotedMessage.findAndFormatContact(msgSource); - msgSource = isMe ? window.i18n('you') : title ? title : msgSource; - return { author: msgSource, id: `${quotedMessage.get('sent_at')}` || '', - // no need to quote the full message length. - text: sliceQuoteText(body), + // NOTE we send the entire body to be consistent with the other platforms + text: body, attachments: quotedAttachments, timestamp: quotedMessage.get('sent_at') || 0, convoId: this.id, diff --git a/ts/receiver/queuedJob.ts b/ts/receiver/queuedJob.ts index 2d8d9ffe6..f1c44562a 100644 --- a/ts/receiver/queuedJob.ts +++ b/ts/receiver/queuedJob.ts @@ -4,7 +4,7 @@ import { Quote } from './types'; import _ from 'lodash'; import { getConversationController } from '../session/conversations'; import { ConversationModel } from '../models/conversation'; -import { MessageModel, sliceQuoteText } from '../models/message'; +import { MessageModel } from '../models/message'; import { Data } from '../../ts/data/data'; import { SignalService } from '../protobuf'; @@ -66,7 +66,8 @@ async function copyFromQuotedMessage( window?.log?.info(`Found quoted message id: ${id}`); quoteLocal.referencedMessageNotFound = false; - quoteLocal.text = sliceQuoteText(found.get('body') || ''); + // NOTE we send the entire body to be consistent with the other platforms + quoteLocal.text = found.get('body') || ''; // no attachments, just save the quote with the body if ( @@ -367,7 +368,7 @@ export async function handleMessageJob( ); } - // save the message model to the db and it save the messageId generated to our in-memory copy + // save the message model to the db and then save the messageId generated to our in-memory copy const id = await messageModel.commit(); messageModel.set({ id });