Fixed issue#286 - Answers from google mail shows complete quote.

This commit is contained in:
Martin Edenhofer 2016-11-04 00:14:43 +01:00
parent c5c22a6b68
commit b9b8f1df46
4 changed files with 31 additions and 2 deletions

View file

@ -4,6 +4,7 @@
- 2016-10-28 Implemented issue#[317](https://github.com/zammad/zammad/issues/317) - Display origin url from tweet/facebook post in article view.
## Zammad 1.0.1
- 2016-11-04 Fixed issue#[286](https://github.com/zammad/zammad/issues/286) - Answers from google mail shows complete quote.
- 2016-11-03 Fixed issue#[348](https://github.com/zammad/zammad/issues/348) - IMAP mail fetching stops because of broken spam email (invalid Content-Transfer-Encoding header)
- 2016-10-29 Fixed issue#[326](https://github.com/zammad/zammad/issues/326) - Create emails via fetchmail / procmail.
- 2016-10-28 Fixed issue#[251](https://github.com/zammad/zammad/issues/251) - Page posts from facebook and tweets from twitter as tickets (new tickets from own posts / tweets will be created as closed now).

View file

@ -97,6 +97,8 @@ class ArticleViewItem extends App.ObserverController
body = body.split('<br>')
body.splice(article.preferences.signature_detection, 0, signatureDetected)
body = body.join('<br>')
else
body = App.Utils.signatureIdentify(body)
article['html'] = body
else

View file

@ -403,7 +403,7 @@ class App.Utils
lineCount = 0
for line in textToSearchInLines
lineCount += 1
if line && line.match( /^.{6,10}\s.{3,10}\s-\s.{1,250}\s(wrote|schrieb):/ )
if line && line.match( /^.{6,10}\s.{3,10}\s-\s.{1,250}\s(wrote|schrieb|a écrit|escribió):/ )
marker =
line: cleanup(line)
lineCount: lineCount
@ -461,7 +461,7 @@ class App.Utils
lineCount = 0
for line in textToSearchInLines
lineCount += 1
if line && line.match( /^.{1,250}\s(wrote|schrieb):/ )
if line && line.match( /^.{1,250}\s(wrote|schrieb|a écrit|escribió):/ )
marker =
line: cleanup(line)
lineCount: lineCount
@ -470,6 +470,21 @@ class App.Utils
return
searchForWord14(textToSearchInLines, markers)
# gmail
# Am 24.10.2016 18:55 schrieb "xxx" <somebody@example.com>:
searchForGmail = (textToSearchInLines, markers) ->
lineCount = 0
for line in textToSearchInLines
lineCount += 1
if line && line.match( /.{1,250}\s(wrote|schrieb|a écrit|escribió)\s.{1,250}:/ )
marker =
line: cleanup(line)
lineCount: lineCount
type: 'gmail'
markers.push marker
return
searchForGmail(textToSearchInLines, markers)
# marker template
markerTemplate = '<span class="js-signatureMarker"></span>'

View file

@ -727,6 +727,17 @@ test("identify signature", function() {
message = "<p><span>test 123</span></p><p><span>test 123</span></p><p><span>--</span></p><p><span>Bob Smith</span></p><div></div>"
should = "<p><span>test 123</span></p><p><span>test 123</span></p><p><span><span class=\"js-signatureMarker\"></span>--</span></p><p><span>Bob Smith</span></p><div></div>"
result = App.Utils.signatureIdentify(message, true)
equal(result, should)
message = "Test reply to zammad<br><br>Am 24.10.2016 18:55 schrieb &quot;Android Support&quot; &lt;android-support@example.com&gt;:<br><br>&gt; <u></u><br>&gt; Sehr geehrte Damen"
should = "Test reply to zammad<br><br><span class=\"js-signatureMarker\"></span>Am 24.10.2016 18:55 schrieb &quot;Android Support&quot; &lt;android-support@example.com&gt;:<br><br>&gt; <u></u><br>&gt; Sehr geehrte Damen"
result = App.Utils.signatureIdentify(message, true)
equal(result, should)
message = "<br>&lt; On 20 Oct 2016, at 12:23, Martin Edenhofer via Zammad Helpdesk wrote:<br>"
should = "<br><span class=\"js-signatureMarker\"></span>&lt; On 20 Oct 2016, at 12:23, Martin Edenhofer via Zammad Helpdesk wrote:<br>"
result = App.Utils.signatureIdentify(message, true)
equal(result, should)
// apple
// en