From 0e1107b9827b5713410feef4aee5ed8b41bb57fb Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 26 Nov 2018 17:25:09 +0100 Subject: [PATCH] fix(email): Dont append last email in the next reply (#6471) In large threads, this leads to snowballing of replies, sometime even reaching more than 5 million characters. Email threads are already maintained in ERPNext, and modern clients are capable of maintaining threads. The only purpose it serves is maintain threads for text based email client, and I think we should ignore that use case, for improved user experience for Frappe/ERPNext users. --- .../public/js/frappe/views/communication.js | 36 +++---------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index eb3b097824..ec7db29b9d 100755 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -614,19 +614,14 @@ frappe.views.CommunicationComposer = Class.extend({ }, setup_earlier_reply: function() { - var fields = this.dialog.fields_dict, - signature = frappe.boot.user.email_signature || "", - last_email = this.last_email; - - if(!last_email) { - last_email = this.frm && this.frm.timeline.get_last_email(true); - } + let fields = this.dialog.fields_dict; + let signature = frappe.boot.user.email_signature || ""; if(!frappe.utils.is_html(signature)) { signature = signature.replace(/\n/g, "
"); } - if(this.txt) { + if (this.txt) { this.message = this.txt + (this.message ? ("

" + this.message) : ""); } else { // saved draft in localStorage @@ -641,29 +636,8 @@ frappe.views.CommunicationComposer = Class.extend({ + this.real_name + ",


" + (this.message || ""); } - var reply = (this.message || "") - + (signature ? ("
" + signature) : ""); - var content = ''; + var reply = (this.message || "") + (signature ? ("
" + signature) : ""); - if(last_email) { - var last_email_content = last_email.original_comment || last_email.content; - - last_email_content = last_email_content - .replace(/<meta[\s\S]*meta>/g, '') // remove tags - .replace(/<style[\s\S]*<\/style>/g, ''); // // remove