From e1f85d571f9694811d9758c8cddbcd3f7a8c25e9 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 11 Feb 2016 17:09:06 +0100 Subject: [PATCH] Improved App.Utils.signatureIdentify() again, ignore messages with less then 8 lines and less then 300 chars. --- app/assets/javascripts/app/lib/app_post/utils.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/lib/app_post/utils.coffee b/app/assets/javascripts/app/lib/app_post/utils.coffee index 661b39db0..3e260783f 100644 --- a/app/assets/javascripts/app/lib/app_post/utils.coffee +++ b/app/assets/javascripts/app/lib/app_post/utils.coffee @@ -250,11 +250,10 @@ class App.Utils @signatureIdentify: (message, test = false) -> textToSearch = @html2text(message) - # count lines, if we do have lower the 8 or more then 300 chars ignore this + # if we do have less then 8 lines and less then 300 chars ignore this textToSearchInLines = textToSearch.split("\n") if !test - return message if textToSearch.length < 300 - return message if textToSearchInLines.length < 8 + return message if textToSearchInLines.length < 8 && textToSearch.length < 300 quote = (str) -> (str + '').replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&")