Quotes: Use authorId when navigating to original message
This commit is contained in:
parent
3715309f9c
commit
0506b79f6b
4 changed files with 12 additions and 8 deletions
|
@ -185,7 +185,10 @@ export type PropsActions = {
|
|||
displayTapToViewMessage: (messageId: string) => unknown;
|
||||
|
||||
openLink: (url: string) => void;
|
||||
scrollToQuotedMessage: (options: { author: string; sentAt: number }) => void;
|
||||
scrollToQuotedMessage: (options: {
|
||||
authorId: string;
|
||||
sentAt: number;
|
||||
}) => void;
|
||||
selectMessage?: (messageId: string, conversationId: string) => unknown;
|
||||
|
||||
showExpiredIncomingTapToViewToast: () => unknown;
|
||||
|
@ -971,7 +974,7 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
? undefined
|
||||
: () => {
|
||||
scrollToQuotedMessage({
|
||||
author: quote.authorId,
|
||||
authorId: quote.authorId,
|
||||
sentAt: quote.sentAt,
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1133,7 +1133,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
bodyRanges: this.processBodyRanges(bodyRanges),
|
||||
isFromMe,
|
||||
sentAt,
|
||||
authorId: author,
|
||||
authorId: contact ? contact.id : undefined,
|
||||
authorPhoneNumber,
|
||||
authorProfileName,
|
||||
authorTitle,
|
||||
|
|
|
@ -14817,7 +14817,7 @@
|
|||
"rule": "React-createRef",
|
||||
"path": "ts/components/conversation/Message.tsx",
|
||||
"line": " public audioRef: React.RefObject<HTMLAudioElement> = React.createRef();",
|
||||
"lineNumber": 223,
|
||||
"lineNumber": 226,
|
||||
"reasonCategory": "usageTrusted",
|
||||
"updated": "2020-09-08T20:19:01.913Z"
|
||||
},
|
||||
|
@ -14825,7 +14825,7 @@
|
|||
"rule": "React-createRef",
|
||||
"path": "ts/components/conversation/Message.tsx",
|
||||
"line": " public focusRef: React.RefObject<HTMLDivElement> = React.createRef();",
|
||||
"lineNumber": 225,
|
||||
"lineNumber": 228,
|
||||
"reasonCategory": "usageTrusted",
|
||||
"updated": "2020-09-08T20:19:01.913Z"
|
||||
},
|
||||
|
@ -14833,7 +14833,7 @@
|
|||
"rule": "React-createRef",
|
||||
"path": "ts/components/conversation/Message.tsx",
|
||||
"line": " > = React.createRef();",
|
||||
"lineNumber": 229,
|
||||
"lineNumber": 232,
|
||||
"reasonCategory": "usageTrusted",
|
||||
"updated": "2020-08-28T19:36:40.817Z"
|
||||
},
|
||||
|
|
|
@ -797,7 +797,7 @@ Whisper.ConversationView = Whisper.View.extend({
|
|||
};
|
||||
|
||||
const scrollToQuotedMessage = async (options: any) => {
|
||||
const { author, sentAt } = options;
|
||||
const { authorId, sentAt } = options;
|
||||
|
||||
const conversationId = this.model.id;
|
||||
const messages = await getMessagesBySentAt(sentAt, {
|
||||
|
@ -806,7 +806,8 @@ Whisper.ConversationView = Whisper.View.extend({
|
|||
const message = messages.find(
|
||||
item =>
|
||||
item.get('conversationId') === conversationId &&
|
||||
item.getSource() === author
|
||||
authorId &&
|
||||
item.getContactId() === authorId
|
||||
);
|
||||
|
||||
if (!message) {
|
||||
|
|
Loading…
Add table
Reference in a new issue