1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00
Commit Graph

46 Commits

Author SHA1 Message Date
cketti
bcb6c75c2e Add support for storing raw header fields 2014-12-08 16:32:23 +01:00
Art O Cathain
40102d560d Set interface makes more sense for flags 2014-10-05 12:40:35 +01:00
Art O Cathain
444756839c EnumSet is more efficient than HashSet 2014-10-05 12:08:55 +01:00
Art O Cathain
02c0b5f2a3 Use collections instead of arrays to enable stronger typing and reduce cruft 2014-10-05 10:37:36 +01:00
Tobias Baum
b6079d6460 UCDetector warnings: Made things private, deleted unused methods and fields 2014-09-22 21:52:59 +02:00
Tobias Baum
5513d5a99b Pulled down getSize from Part to Message which makes ImapBodyPart superfluous 2014-09-14 11:11:48 +02:00
András Veres-Szentkirályi
ab3044c9fa use Set instead of implementation type 2014-02-15 23:59:24 +01:00
Joe Steele
1ca1ef5c84 Content-type case-conversion changes.
Don't convert the content-type to lower case in
MimeMessage.getContentType.  The content-type may have optional parameters
that are case sensitive (boundary, name).

In removing the lower-case conversion from getContentType, a review was
made for inappropriate case-sensitive comparisons which use data obtained
with getContentType.  The only ones found were in isMimeType in both
Message and MimeBodyPart.

Case-sensitive instances of isMimeType were made case-insensitive.  Also,
isMimeType was moved from Message to MimeMessage for symmetry with
MimeBodyPart (MimeMessage & MimeBodyPart are similar and contain a good
bit of duplication such as this).

The unit test required fixing now that the case of the boundary text is
preserved.

References:

Commits 2c5186 and dc4002 added the toLowerCase to getContentType in
MimeMessage & MimeBodyPart (Issue 94).

Later, commit 50cd60 removed the toLowerCase addition from MimeBodyPart
(Issue 1289).
2013-09-03 19:54:18 -04:00
Joe Steele
45e3d8459e Recursively convert attachments of type message/rfc822 to 7bit if necessary.
The preceding commit resulted in attachments of type message/rfc822 being
sent with 8bit encoding even when the SMTP server did not support
8BITMIME.  This commit assures that messages will be converted to 7bit
when necessary.

A new interface CompositeBody was created that extends Body, and classes
Message and Multipart were changed from implementing Body to
CompositeBody.  Additional classes BinaryTempFileMessageBody and
LocalAttachmentMessageBody were created (by extending BinaryTempFileBody
and LocalAttachmentBody, respectively), and they too implement
CompositeBody.

A CompositeBody is a Body containing a composite-type that can contain
subparts that may require recursive processing when converting from 8bit
to 7bit.  The Part to which a CompositeBody belongs is only permitted to
use 8bit or 7bit encoding for the CompositeBody.

Previously, a Message was created so that it was 7bit clean by default
(even though that meant base64 encoding all attachments, including
messages).  Then, if the SMTP server supported 8BITMIME,
Message.setEncoding("8bit") was called so that bodies of type TextBody
would been transmitted using 8bit encoding rather than quoted-printable.

Now, messages are created with 8bit encoding by default.  Then, if the
SMTP server does not support 8BITMIME, Message.setUsing7bitTransport is
called to recursively convert the message and its subparts to 7bit.  The
method setUsing7bitTransport was added to the interfaces Part and
CompositeBody.

setEncoding no longer iterates over parts in Multipart.  That task belongs
to setUsing7bitTransport, which may in turn call setEncoding on the parts.

MimeUtility.getEncodingforType was created as a helper function for
choosing a default encoding that should be used for a given MIME type when
an attachment is added to a message (either while composing or when
retrieving from LocalStore).

setEncoding was implemented in MimeBodyPart to assure that the encoding
set in the Part's headers was the same as set for the Part's Body.  (The
method already existed in MimeMessage, which has similarities with
MimeBodyPart.)

MimeMessage.parse(InputStream in, boolean recurse) was implemented so that
the parser could be told to recursively process nested messages read from
the InputStream, thus giving access to all subparts at any level that may
need to be converted from 8bit to 7bit.
2013-09-03 19:53:13 -04:00
Danny Baumann
45328189f3 Strip off signatures from preview. 2013-01-07 10:39:08 +01:00
Danny Baumann
6f7ec3e401 Incorporate review comments. 2013-01-05 13:21:17 +01:00
cketti
ec76dca57f Remove unused stuff 2012-10-24 01:37:33 +02:00
Jesse Vincent
0c34a21ff0 Add a fromMe method on messages 2012-10-03 21:56:28 -04:00
Rob Bayer
fdb1267cb1 Add remote IMAP search support.
* rbayer/IMAPsearch: (21 commits)
  More cleanup
  Code Cleanup getRemoteSearchFullText -> isRemoteSearchFullText line wraps for preference items
  Refactor to allow fetching of extra search results beyond original request.  Most code moved out of ImapStore and ImapFolder and into MessagingController.searchRemoteMessagesSynchronous.  Should make it easier to add remoteSearch for other server types.
  Prevent delete of search results while search results open
  remove duplicated code block
  Don't hide Crypto when IMAPsearch disabled
  Code Style Cleanup: Tabs -> 4 spaces Remove trailing whitespace from blank lines
  tabs -> spaces (my bad...)
  Fix opening of folders to be Read-Write when necessary, even if they were previously opened Read-Only.
  add missing file
  Working IMAP search, with passable UI.
  UI improvements
  Simple help info when enabling Remote Search
  Dependency for preferences
  Basic IMAP search working
2012-09-13 09:10:37 -07:00
Jesse Vincent
3799ecfb21 Check message uids first when comparing messages. message uids are less likely to be the same than folders, so it's a slight optimization 2012-09-12 21:56:17 -05:00
cketti
71174417ce Clone Message object to avoid ConcurrentModificationExceptions
Fixes issue 3953
2012-01-04 03:57:53 +01:00
Andrew Gaul
2599bdcc75 Log Throwable instead of concatenating 2011-11-02 22:18:30 -07:00
Jesse Vincent
604e532879 Add a method to calculate a message's serialized size 2011-03-27 23:08:25 +08:00
Jesse Vincent
12d1097a24 Big, scary massive "ant astyle" to get us back to something
approximating AOSP coding standards.
2011-02-06 17:09:48 -05:00
Jesse Vincent
2daf8eaec8 Allow emoji input.
Signed-off-by: HIRANO Takahito <hiranotaka@zng.info>
2011-01-04 13:25:59 +00:00
Jesse Vincent
78c900b5fe remove redundant ;s 2010-12-01 03:07:28 +00:00
Jesse Vincent
c79ea226a5 Remove "throws" declarations that didn't actually get thrown. Remove a
couple of try blocks that only caught throws we didn't throw. IntelliJ
optimization.
2010-12-01 03:02:13 +00:00
Jesse Vincent
36bb10fb2c extract out "sync one account" 2010-11-28 20:28:42 +00:00
Jesse Vincent
f9981dcf7c lift hasAttachments to LocalMessage 2010-11-27 04:02:56 +00:00
Jesse Vincent
14055691a3 Merge branch 'mail-on-sd'
* mail-on-sd: (40 commits)
  Added more comments to explain how the locking mecanism works for LocalStore
  Fixed wrong method being called during experimental provider initialization (since provider isn't enabled, that didn't harm)
  Add more comments about how the various StorageProviders work and how they're enabled
  find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs
  French localization for storage related settings
  Remove unused SD card strings (replaced with storage indirection)
  Merge mail-on-sd branch from trunk
  Reset mail service on storage mount (even if no account uses the storage, to be improved)
  find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs
  Migraion -> Migration
  move the Storage location preference into preferences rather than the wizard.
  Made LocalStore log less verbose Added @Override compile checks
  Added ACTION_SHUTDOWN broadcast receiver to properly initiate shutdown sequence (not yet implemented) and cancel any scheduled Intent
  Be more consistent about which SQLiteDatabase variable is used (from instance variable to argument variable) to make code more refactoring-friendly (class is already big, code extraction should be easier if not referencing the instance variable).
  Added transaction timing logging
  Factorised storage lock/transaction handling code for regular operations.
  Use DB transactions to batch modifications (makes code more robust / could improve performances)
  Merge mail-on-sd branch from trunk
  Update issue 888 Added DB close on unmount / DB open on mount
  Update issue 888 Back to account list when underlying storage not available/unmounting in MessageView / MessageList
  ...
2010-11-13 21:40:56 +00:00
Jesse Vincent
2d8a8998b0 factor out a "destroy" method for local messages 2010-11-12 21:38:02 +00:00
Fiouz
e16a79d08c Javadoc comment 2010-09-12 06:11:08 +00:00
Jesse Vincent
4f0bce1569 Simplify many, many boolean conditions with help from IntelliJ 2010-08-29 23:39:26 +00:00
Fiouz
dfb8f9e0f2 Memory management optimisation: help garbage collection by avoiding repeated instantiations of immutable arrays (empty arrays of String, Message, Flag, Address) 2010-08-07 15:10:07 +00:00
Jesse Vincent
a85c83f696 Revert "When deciding whether a message is older than a certain date, we should"
This reverts commit 98cab91631692b55ba72231126f612d6b4d4d662.

As Dan rightly suspected, it made pop3 sad :/
2010-07-13 21:16:49 +00:00
Jesse Vincent
52ff331771 When deciding whether a message is older than a certain date, we should
be prefering the date we can ~trust "Internal" to the date asserted by
the sender.
2010-07-10 16:40:13 +00:00
Jesse Vincent
ee63564138 "ReceivedDate" was an unused concept. Its value was never set. 2010-07-10 16:40:00 +00:00
Jesse Vincent
a826f33eb3 find src/com/fsck/ -name \*.java|xargs astyle --style=ansi
--mode=java --indent-switches --indent=spaces=4 --convert-tabs
--unpad=paren
2010-07-06 10:29:26 +00:00
cketti
4a6b99b647 Fixed some warnings 2010-06-20 14:19:01 +00:00
Daniel Applebaum
b35f807820 Fixes Issue 227
Provide for controlling the maximum age of syncrhonized messages.
Efficient with IMAP, much less efficient with other Stores.
2010-05-30 21:20:47 +00:00
cketti
c5486469c2 - Add menu item to show additional headers in the message view
- Add option to save all headers locally (incoming server settings)

Applied patch provided by timmlinder with small modifications.

Fixes issue 43
2010-05-21 15:34:29 +00:00
Jesse Vincent
ba021597c4 astyle 2010-05-12 02:51:59 +00:00
cketti
683f31e32e Code cleanup: Fixed some warnings 2010-05-03 13:46:55 +00:00
Daniel Applebaum
ee1b4b70e2 Fixes Issue 1412
Keep search results in sync with newly arrived or deleted messages.
Intentionally does not remove messages from search results due to
flag (flagged/starred or read/unread) state changes, because that
would be awkward while manipulating messages in search results.
2010-05-01 20:06:52 +00:00
cketti
45036ae5c8 Use 8bit transfer encoding for the text body if SMTP server advertises 8BITMIME. In all other cases base64 is still used (including saved copies in IMAP "Sent" folder).
Feel free to revert this if anything breaks.
2010-02-04 23:37:50 +00:00
Jesse Vincent
f31b2702a4 Massive rename to K9, step 1.
Conflicts:

	src/com/android/email/Email.java
2009-12-15 02:50:53 +00:00
Jesse Vincent
eedfc0a839 step 1 of rename 2008-12-16 23:07:33 +00:00
Jesse Vincent
5491dee81b Damn it. Weird symlink-in-checkout bug. There goes our commit history. Sorry, all.
Guess I should go back to svk
2008-11-01 21:32:06 +00:00
Jesse Vincent
12c6e53141 bin directory should never have been checked in 2008-11-01 21:23:45 +00:00
Jesse Vincent
c00ec35921 Grand insane rename, step 3 2008-10-28 01:22:17 +00:00
Jesse Vincent
7051cf8cc0 move step 2 2008-10-28 01:19:57 +00:00