From b47ffdd9259b3c0c152a9f2522757338d91f1ca6 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 30 Apr 2015 09:23:01 +0200 Subject: [PATCH] Added fr support for App.Utils.signatureIdentify(). --- app/assets/javascripts/app/lib/app_post/utils.js.coffee | 9 +++++++-- public/assets/tests/html-utils.js | 7 +++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/lib/app_post/utils.js.coffee b/app/assets/javascripts/app/lib/app_post/utils.js.coffee index 933e8e7d6..f008f1e90 100644 --- a/app/assets/javascripts/app/lib/app_post/utils.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/utils.js.coffee @@ -305,6 +305,11 @@ class App.Utils # To/Cc/Bcc: xxx # Date: 01.04.2015 12:41 # Subject: xxx + # - or - + # De : xxx + # À/?/?: xxx + # Envoyé : mercredi 29 avril 2015 17:31 + # Objet : xxx searchForMs = (textToSearchInLines, markers) -> lineCount = 0 fromFound = undefined @@ -315,7 +320,7 @@ class App.Utils # find Sent if fromFound - if line && line.match( /^(Subject|Betreff):\s.+?/) + if line && line.match( /^(Subject|Betreff|Objet)(\s|):\s.+?/) # en/de/fr | sometimes ms adds a space to "xx : value" marker = line: fromFound lineCount: lineCount @@ -327,7 +332,7 @@ class App.Utils # find From else - if line && line.match( /^(From|Von):\s.+?/ ) + if line && line.match( /^(From|Von|De)(\s|):\s.+?/ ) # en/de/fr | sometimes ms adds a space to "xx : value" fromFound = line.replace(/\s{0,5}(\[|<).+?(\]|>)/g, '') foundInLines = lineCount searchForMs(textToSearchInLines, markers) diff --git a/public/assets/tests/html-utils.js b/public/assets/tests/html-utils.js index b0911d8cd..1e8ea4640 100644 --- a/public/assets/tests/html-utils.js +++ b/public/assets/tests/html-utils.js @@ -599,6 +599,13 @@ test( "identify signature", function() { result = App.Utils.signatureIdentify( message, true ) equal( result, should ) + // fr + message = "
test 123

--no not match--

Bob Smith
De : Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]
Envoyé : mercredi 29 avril 2015 17:31
Objet : lalala
" + should = '
test 123

--no not match--

Bob Smith
De : Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]
Envoyé : mercredi 29 avril 2015 17:31
Objet : lalala
' + result = App.Utils.signatureIdentify( message, true ) + equal( result, should ) + + // thunderbird // de message = "

Viele Grüße,
Christian

Am 04.03.2015 um 12:47 schrieb Martin Edenhofer via Znuny Sales:
> Hallo Christian,
"