Message Detail: Ensure that quotes are not clickable

This commit is contained in:
Scott Nonnenberg 2019-03-12 10:17:01 -07:00
parent 601ad3773c
commit 768007a269
2 changed files with 16 additions and 13 deletions

View file

@ -452,7 +452,7 @@
snippet: this.get('snippet'), snippet: this.get('snippet'),
}; };
}, },
getPropsForMessage() { getPropsForMessage(options) {
const phoneNumber = this.getSource(); const phoneNumber = this.getSource();
const contact = this.findAndFormatContact(phoneNumber); const contact = this.findAndFormatContact(phoneNumber);
const contactModel = this.findContact(phoneNumber); const contactModel = this.findContact(phoneNumber);
@ -491,7 +491,7 @@
.filter(attachment => !attachment.error) .filter(attachment => !attachment.error)
.map(attachment => this.getPropsForAttachment(attachment)), .map(attachment => this.getPropsForAttachment(attachment)),
previews: this.getPropsForPreview(), previews: this.getPropsForPreview(),
quote: this.getPropsForQuote(), quote: this.getPropsForQuote(options),
authorAvatarPath, authorAvatarPath,
isExpired: this.hasExpired, isExpired: this.hasExpired,
expirationLength, expirationLength,
@ -601,7 +601,8 @@
image: preview.image ? this.getPropsForAttachment(preview.image) : null, image: preview.image ? this.getPropsForAttachment(preview.image) : null,
})); }));
}, },
getPropsForQuote() { getPropsForQuote(options = {}) {
const { noClick } = options;
const quote = this.get('quote'); const quote = this.get('quote');
if (!quote) { if (!quote) {
return null; return null;
@ -620,13 +621,15 @@
const authorProfileName = contact ? contact.getProfileName() : null; const authorProfileName = contact ? contact.getProfileName() : null;
const authorName = contact ? contact.getName() : null; const authorName = contact ? contact.getName() : null;
const isFromMe = contact ? contact.id === this.OUR_NUMBER : false; const isFromMe = contact ? contact.id === this.OUR_NUMBER : false;
const onClick = () => { const onClick = noClick
this.trigger('scroll-to-message', { ? null
author, : () => {
id, this.trigger('scroll-to-message', {
referencedMessageNotFound, author,
}); id,
}; referencedMessageNotFound,
});
};
const firstAttachment = quote.attachments && quote.attachments[0]; const firstAttachment = quote.attachments && quote.attachments[0];
@ -753,7 +756,7 @@
sentAt: this.get('sent_at'), sentAt: this.get('sent_at'),
receivedAt: this.get('received_at'), receivedAt: this.get('received_at'),
message: { message: {
...this.getPropsForMessage(), ...this.getPropsForMessage({ noClick: true }),
disableMenu: true, disableMenu: true,
// To ensure that group avatar doesn't show up // To ensure that group avatar doesn't show up
conversationType: 'direct', conversationType: 'direct',

View file

@ -207,7 +207,7 @@
"rule": "jQuery-wrap(", "rule": "jQuery-wrap(",
"path": "js/models/messages.js", "path": "js/models/messages.js",
"line": " return this.send(wrap(promise));", "line": " return this.send(wrap(promise));",
"lineNumber": 935, "lineNumber": 938,
"reasonCategory": "falseMatch", "reasonCategory": "falseMatch",
"updated": "2018-10-05T23:12:28.961Z" "updated": "2018-10-05T23:12:28.961Z"
}, },
@ -215,7 +215,7 @@
"rule": "jQuery-wrap(", "rule": "jQuery-wrap(",
"path": "js/models/messages.js", "path": "js/models/messages.js",
"line": " return wrap(", "line": " return wrap(",
"lineNumber": 1182, "lineNumber": 1185,
"reasonCategory": "falseMatch", "reasonCategory": "falseMatch",
"updated": "2018-10-05T23:12:28.961Z" "updated": "2018-10-05T23:12:28.961Z"
}, },