diff --git a/js/models/messages.js b/js/models/messages.js index 53cea9e3de..1a18f282ba 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -452,7 +452,7 @@ snippet: this.get('snippet'), }; }, - getPropsForMessage() { + getPropsForMessage(options) { const phoneNumber = this.getSource(); const contact = this.findAndFormatContact(phoneNumber); const contactModel = this.findContact(phoneNumber); @@ -491,7 +491,7 @@ .filter(attachment => !attachment.error) .map(attachment => this.getPropsForAttachment(attachment)), previews: this.getPropsForPreview(), - quote: this.getPropsForQuote(), + quote: this.getPropsForQuote(options), authorAvatarPath, isExpired: this.hasExpired, expirationLength, @@ -601,7 +601,8 @@ image: preview.image ? this.getPropsForAttachment(preview.image) : null, })); }, - getPropsForQuote() { + getPropsForQuote(options = {}) { + const { noClick } = options; const quote = this.get('quote'); if (!quote) { return null; @@ -620,13 +621,15 @@ const authorProfileName = contact ? contact.getProfileName() : null; const authorName = contact ? contact.getName() : null; const isFromMe = contact ? contact.id === this.OUR_NUMBER : false; - const onClick = () => { - this.trigger('scroll-to-message', { - author, - id, - referencedMessageNotFound, - }); - }; + const onClick = noClick + ? null + : () => { + this.trigger('scroll-to-message', { + author, + id, + referencedMessageNotFound, + }); + }; const firstAttachment = quote.attachments && quote.attachments[0]; @@ -753,7 +756,7 @@ sentAt: this.get('sent_at'), receivedAt: this.get('received_at'), message: { - ...this.getPropsForMessage(), + ...this.getPropsForMessage({ noClick: true }), disableMenu: true, // To ensure that group avatar doesn't show up conversationType: 'direct', diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index 6b1aebb9df..71890fb39f 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -207,7 +207,7 @@ "rule": "jQuery-wrap(", "path": "js/models/messages.js", "line": " return this.send(wrap(promise));", - "lineNumber": 935, + "lineNumber": 938, "reasonCategory": "falseMatch", "updated": "2018-10-05T23:12:28.961Z" }, @@ -215,7 +215,7 @@ "rule": "jQuery-wrap(", "path": "js/models/messages.js", "line": " return wrap(", - "lineNumber": 1182, + "lineNumber": 1185, "reasonCategory": "falseMatch", "updated": "2018-10-05T23:12:28.961Z" },