Commit graph

646 commits

Author SHA1 Message Date
cketti
f11b170a42 Make MessagingController.saveDraft() return message database ID 2020-10-19 09:25:56 +02:00
cketti
54e5d8af9c Change the way we replace drafts on the server
Don't overwrite the previous draft in the database. Create a new message entry and convert the previous one to a 'deleted' placeholder.
This also introduces a new pending command 'replace'. It is implemented as upload + delete.
2020-10-19 09:25:56 +02:00
cketti
1ef1af8b0f Log stack trace when pending commands fail 2020-10-18 22:01:44 +02:00
cketti
45bf5d0aef Inline constant parameter value (we always upload drafts if possible) 2020-10-18 21:53:34 +02:00
cketti
36c9e799f1 Don't use magic value when draft message ID is missing 2020-10-18 21:53:34 +02:00
cketti
1fecd0b588 Convert code to save drafts to Kotlin 2020-10-18 21:53:34 +02:00
cketti
1873593dc5 Format Kotlin code 2020-10-16 16:41:19 +02:00
cketti
ed8009d9fa Update ktlint-gradle to 9.4.1, ktlint to 0.39.0
Apply ktlint-gradle plugin to all Gradle subprojects.
2020-10-16 14:27:23 +02:00
cketti
d2fd52e206 Manually fix up formatting of some raw strings 2020-10-16 12:54:30 +02:00
cketti
a2ac5b167e Change the way moving messages between folders in the database works
Previously, when moving a message, the entry in the `messages` table was rewritten to reference the destination folder. Then a "deleted" message entry was created referencing the source folder.
This commit changes the move code to create a new entry for the message in the destination folder and then changes the original message entry to be a "deleted" entry.
It's a first step towards being able to use a message's database ID instead of the server ID in "pending commands".

This also continues the project of moving database-related code to the `storage` module. There should now be enough scaffolding in place to make moving code from `LocalStore` and `LocalFolder` relatively painless.
2020-10-15 23:51:49 +02:00
cketti
3921f57906
Merge pull request #5005 from k9mail/fix_urls_in_drafts
Fix URLs in drafts
2020-10-13 04:10:58 +02:00
cketti
2a67408981 Fix URLs in drafts
When converting from HTML to plain text, if the link text is identical to the link URL, only output the URL.
2020-10-13 03:57:47 +02:00
cketti
1835b502b5
Merge pull request #5001 from k9mail/no_encoding_in_MimeHeader
No encoding in MimeHeader
2020-10-13 03:54:13 +02:00
cketti
e3178a5117
Merge pull request #5003 from k9mail/show_recipient_name
Show recipient name for all messages in Sent, Drafts, and Outbox folders
2020-10-13 03:41:10 +02:00
cketti
5bc7ac3901 When constructing new messages check header values 2020-10-13 03:29:20 +02:00
cketti
733624cfcf
Merge pull request #4998 from k9mail/fix_EmailSectionExtractor
Fix EmailSectionExtractor
2020-10-13 03:17:28 +02:00
cketti
5f05b8bb07 Show sender/recipient name in message list based on folder
The recipient name is shown for messages in the Sent, Drafts, and Outbox folders. For messages in all other folders the sender name is shown.
2020-10-12 01:48:36 +02:00
cketti
fac346009a Only pass encoded headers to MimeHeader
Remove code to encode header values from from MimeHeader.writeTo()
2020-10-11 02:28:36 +02:00
cketti
82f8a78e88 EmailSectionExtractor: Don't consider blank lines for indentation depth 2020-10-10 01:49:13 +02:00
cketti
955f556afa Fix EmailSectionExtractor to support empty quoted lines 2020-10-10 00:36:07 +02:00
cketti
ea7ca6e3d4 Make HTTP URL detection work with parentheses 2020-10-09 04:29:02 +02:00
cketti
b1d21dc27c Clean up 'HttpUriParser'
There shouldn't be any functional changes.
2020-10-09 02:33:11 +02:00
cketti
76e43a411d Convert 'HttpUriParser' to Kotlin 2020-10-09 00:52:18 +02:00
cketti
e4297b3a4c Rename 'HttpUriParser' prior to conversion to Kotlin 2020-10-09 00:37:51 +02:00
cketti
68405c91b4
Merge pull request #4991 from k9mail/signature_detection_fix
Fix bug in signature detection
2020-10-07 16:54:44 +02:00
cketti
1a58f4d4f0 Fix bug in signature detection
When SignatureWrapper detected a signature it would exclude the last character of the text. This lead to an exception being thrown when the signature ended with a URL and the HtmlModification instance for the URL would not be fully contained within the one for the signature.
2020-10-07 15:43:29 +02:00
cketti
5312c3d1ca Treat all whitespace as separator when detecting URIs 2020-10-06 22:39:04 +02:00
cketti
0c77513407
Merge pull request #4986 from k9mail/GH-4984_fix_preview_text_extraction
Fix preview text extraction
2020-10-06 16:11:40 +02:00
cketti
b8edb11eea
Merge pull request #4983 from k9mail/signature_display
De-emphasize signature when displaying text/plain part
2020-10-06 16:10:07 +02:00
cketti
e3b8855bdd Catch unexpected exceptions in MessagePreviewCreator 2020-10-06 15:15:19 +02:00
cketti
15ca949698 Make PreviewTextExtractor work with empty string 2020-10-06 15:11:02 +02:00
cketti
ca5a044247 De-emphasize signature when displaying text/plain part 2020-10-05 18:27:10 +02:00
cketti
7d6ca63cf2 Add support for nested HtmlModifications to TextToHtml 2020-10-05 18:13:55 +02:00
cketti
3133573139 Rewrite Share functionality in message view screen
The shared text now contains subject, date, sender, and recipients in addition to the message body text.
2020-10-05 05:38:54 +02:00
cketti
a1e9a521e3 Replace somewhat complex regular expression with code
Apparently the regular expression \n*(?:[^\n]+\n?)+:\n+$ is complex enough so matching takes the regex engine on Android forever on non-trivial inputs.
2020-10-03 02:28:48 +02:00
cketti
99ce09f19d Improve preview text extraction
Using 'EmailSectionExtractor' provides the necessary context to reliably detect quote headers, i.e. text like "On $date $sender wrote:". The regular expression previously used would remove almost any line ending with ":".
2020-10-03 02:28:48 +02:00
cketti
6a25709e09 Convert 'PreviewTextExtractorTest' to Kotlin 2020-09-30 03:00:20 +02:00
cketti
4c08c964e7 Rename 'PreviewTextExtractorTest' prior to conversion to Kotlin 2020-09-30 03:00:20 +02:00
cketti
bb4ed7a15c Convert 'PreviewTextExtractor' to Kotlin 2020-09-29 23:31:24 +02:00
cketti
ab4e0229dc Rename 'PreviewTextExtractor' prior to conversion to Kotlin 2020-09-29 23:22:15 +02:00
cketti
b82be6f374 Retain some attributes of <body> element during HTML sanitization 2020-09-20 18:01:00 +02:00
cketti
10ce58d603 Add <title> tag to allow list 2020-09-20 17:42:35 +02:00
cketti
ec34b96bfa Convert 'HtmlSanitizerTest' to Kotlin 2020-09-20 17:42:35 +02:00
cketti
796eabb705 Rename 'HtmlSanitizerTest' prior to conversion to Kotlin 2020-09-20 17:42:35 +02:00
cketti
fc45e059fc Update to targetSdkVersion 29 2020-09-20 01:29:50 +02:00
cketti
391d8e403c Use mocked QuoteDateFormatter in TextQuoteCreatorTest 2020-09-20 01:08:39 +02:00
cketti
fd9d6f8d95 Use default Locale in QuoteDateFormatter 2020-09-20 01:04:33 +02:00
cketti
2db24bec08 Change QuoteHelper into QuoteDateFormatter 2020-09-19 20:44:54 +02:00
cketti
075fb35cd9 Get rid of QuoteHelper.QUOTE_BUFFER_LENGTH 2020-09-19 19:51:13 +02:00
cketti
e79dacd126 Use buildString() helper in TextQuoteCreator 2020-09-19 19:27:56 +02:00