Commit Graph

36 Commits

Author SHA1 Message Date
Jesse Vincent 88e6c59e7e Get K-9 building on Java 1.5 again 2009-12-06 22:41:19 +00:00
Daniel Applebaum c7e7b9beda Bulk deletion for IMAP and stub for other Stores. 2009-11-29 18:07:34 +00:00
Daniel Applebaum f1abdbb769 Bulk flagging (read/unread, flag/unflag) implemented.
Message List batch ops wired to bulk flagging.

Manage batch button state when messages are deleted (from outside
agents) while in batch mode.

Remove throws clause from Folder.close() to make it easier to close
folders where necessary.

Eliminate some cruft from MessageList

Consolidate unreadMessageCount fetching in notifyAccount
2009-11-29 16:55:35 +00:00
Daniel Applebaum d871d2d2ee Fixes Issue 827
Fixes Issue 734

On reconnection, IMAP IDLE folders will now fetch up to the most
recent 10 message that arrived while a IDLE connection was not
available.

Fixes Issue 232

A serving of NAMESPACE-based auto-configuration on the side.  If the
IMAP prefix is empty, and the IMAP server supports NAMESPACE, use the
IMAP prefix supplied by NAMESPACE.  Also, if the user manually puts
the separator as the last character in the prefix, don't append the
separator.

Also:
Improved reliability of IMAP IDLE incoming message and flag state
change handling.  Reduction (but not elimination) of multiple
connections under startup conditions.
2009-11-28 14:51:44 +00:00
Daniel Applebaum fc91603429 Major IMAP IDLE rework:
1) Actual message sync on MessagingController uses same connection as
   IDLE for faster and more efficient push operation.  Uses fewer
   connections to the server.

2) More aggressive handling of untagged responses should more reliably
   get flag changes and new messages when many events happen at once.

3) Simplification of new mail notification

4) Push mail now respects the folder visible limit

5) When multiple untagged FETCH responses arrive en bloc, the actual
   message flags and UIDs are fetched with a single request
2009-11-26 05:10:12 +00:00
Jesse Vincent 9cac2cd5b7 applied compromise code reformatting:
find  src/com/android/email/ -name \*java|xargs astyle --style=ansi \
    --mode=java  --indent-switches --indent=spaces=4 --convert-tabs \
    --unpad=paren
2009-11-25 00:40:29 +00:00
Daniel Applebaum 694ba471d4 Eliminate race condition which causes multiple connections to IDLE
simultaneously
2009-11-23 03:16:44 +00:00
Daniel Applebaum b551850827 Fixes Issue 188
Fixes Issue 394
Fixes Issue 763

Completely new Services architecture providing proper Service
lifecycle management.
  Long running tasks in MailService are executed in a separate thread,
  but the service is not stopped until the tasks are complete.

  SleepService for providing synchronous sleeps with proper WakeLock
  integration.

  Mail polling logic moved from MailService to PollService

  PushService to keep application from being killed while push is
  running.

Improved logging of IMAP protocol, including logging folder name,
thread and connection hashcode.

Don't put a failed connection back into the IMAP mConnections
storage. 

IMAP IDLE uses new SleepService for delaying between failed connection
attempts (allows phone to sleep and provides better reliability)

Use a ThreadLocal for ImapPusher wakelocks

Component enablement/disablement in Email is done only when components
are out of phase with desired state. (Issue 188)
2009-11-22 17:01:04 +00:00
Daniel Applebaum a7a46ac6fa Fixes Issue 673 2009-11-19 15:19:23 +00:00
Jesse Vincent 35ab566f43 Cleanup of the LocalFolder perf optimization from last night. 2009-11-17 19:25:46 +00:00
Jesse Vincent c6b5a626bd Merge branch 'skip-deleted-in-sqlite'
* skip-deleted-in-sqlite:
  Create branch skip-deleted-in-sqlite
  First pass at doing our "don't show deleted messages in lists" filtering in SQL
2009-11-17 16:54:50 +00:00
Daniel Applebaum 22bfa74ddf Fixes Issue 733 2009-11-07 20:27:30 +00:00
Daniel Applebaum 90198382a4 Increase chance of Push mail picking up messages when connectivity is
restored.
2009-11-07 16:51:08 +00:00
Daniel Applebaum 25e36da75d Fixes Issue 712. 2009-10-25 23:56:25 +00:00
Daniel Applebaum 959404cc68 Issue 4: Implements Push Mail for IMAP accounts using IMAP IDLE
This commit contains the entirety of the changes performed in the
issue4-1.X branch from revision 718 through revision 851.  Because the
issue4-1.X branch was up-to-date with trunk revision 847 at revision
849, the source of this commit was not an "svn merge".  Instead, it is
merely a copy of all changed files from the issue4-1.X branch to my
trunk working copy and a straight commit.

Also:
Issue 551
Issue 628
Issue 650
Issue 654
Issue 656
Issue 682
Issue 696
2009-10-22 00:41:06 +00:00
Daniel Applebaum b4b1b081a7 Issue 624
Don't bother going to server while creating an ImapMessage from a UID
2009-09-24 01:06:24 +00:00
Daniel Applebaum 10b9b0a05b Issue 117
Issue 30

Provide support for multiple identities.  Identities can be managed in
the Account Settings.  While composing a message, an identity can be
chosen for sending.  Identity information and signature edits are
saved in a header field, so that they survive being synced to the
server and back.

Provide support for editing the quoted text, either for replies or
forwards.  The quoted text is immediately editable, in a separate
editor from the main body.  When saved in a draft, the two are
contatenated, but the length of the main body is saved with the
identity information, and is used to split the two parts again, when
opening the draft.
2009-06-09 03:11:35 +00:00
Bao-Long Nguyen-Trong 49426f3107 Removed some logging that should not have made it to SVN 2009-05-21 18:53:27 +00:00
Bao-Long Nguyen-Trong 435e2c3532 Fixed issue 404:
. Free up memory as we go in MessagingController.synchronizeMailboxSynchronous()
  . IMAP: We only do a partial fetch of the text body of large messages during background sync. This allow for faster syncs and avoid expensive parsing that lead to OutOfMemoryError
2009-05-20 04:27:51 +00:00
Daniel Applebaum 96c98e3070 Reformat executeSimpleCommand 2009-05-06 00:16:47 +00:00
Daniel Applebaum 27e0ec1b80 Decrement mMessageCount when an untagged EXPUNGE is received 2009-05-06 00:12:30 +00:00
Daniel Applebaum aac64b03a5 Make sure not to lose an untagged EXISTS, even if it came during a
command that we didn't handle properly.
2009-05-05 04:03:56 +00:00
Daniel Applebaum 651642faeb Automatically re-synchronize the IMAP protocol. Previously, losses of
synchronization could happen if an Exception was thrown while parsing
an untagged response without using executeSimpleCommand.  For
instance, while doing a fetch.  Once synchronization was lost, later
commands would fail in surprising ways.  One manifestation of such
failures was spontaneously emptying of folders when search results
were not returned properly.  The new code makes sure to only accept OK
responses with the tag of the command, and discards the untagged
responses from previous command.
2009-05-05 00:42:05 +00:00
Daniel Applebaum d1661ee1f5 Reset mMessageCount before executing SELECT. Only handle untagged
responses to SELECT once.
2009-04-21 05:34:57 +00:00
Daniel Applebaum f0f07c36de Issue 63
Issue 201
Issue 224
Issue 342

Handle untagged EXISTS messages at any time.  Should increase
synchronization speed and accuracy.

Handle IMAP servers that send a NIL where a literal is normally.
Avoids failure to sync when folder contains certain messages.

Throw Exception if folder message count is less than 0, avoiding
accidentally emptying a folder.
2009-04-21 04:22:02 +00:00
Daniel Applebaum aa4a92a541 Application of patch submitted by cnehren for Issue 356, with
generalization.
2009-04-11 15:24:22 +00:00
Daniel Applebaum 15e5cb4eaf Provides the ability to move and copy messages between folders. Issue
3.

Each remote Store (IMAP, POP3, WebDAV) can provide indications to the
higher level classes as to whether copy and move are implemented.
Currently, copy and move are only provided by ImapStore.java.  When
the facilities are not available, the user interface suppresses the
menu options.

The available destination folders can be configured using folder
classes.

Copy results in null message bodies in the destination copy of the
message until the next sync.  This is a problem that occurred with
deletes previously, and is likely a fault with the copyMessages method
of LocalStore.java.

Utilizes a modified version of the ChooseFolder.java Activity that
debuachedsloth contributed in a patch attached to Issue 285 on 16 Feb
2008.
2009-03-05 07:32:45 +00:00
Daniel Applebaum 2d31b4e52d Issue 179 and Issue 320
Puts quotes around username and password for IMAP authentication.

Also, if authentication fails, closes the connection so that it will
be retried.  Otherwise, there is no way to fix the problem, say, by
changing the password in the Incoming Settings.
2009-02-25 01:50:20 +00:00
Daniel Applebaum b6e9910e00 Needed for r326 Issue 91 2009-01-24 18:54:47 +00:00
Daniel Applebaum 172adeee22 Add ability to Flag/Unflag messages. Flagged messages are shown with
a red/bold subject.  Can be done in the FolderMessageList using the
hotkey G (toggle) or by long-pressing the message to bring up the
message context menu.  Can be done while viewing an individual message
by using the hotkey G (toggle).  To-do: add a Flag/Unflag option to a
menu in the individual message view.

Add sending the Answered flag to the IMAP server when replying to a
message.  This is currently done as soon as the reply is started.
Perhaps it would be better to wait until the reply is sent, but that
would require keeping additional state with the draft.  Messages to
which the user has replied are indicated with a white arrow next to
the subject.

To-do: In the MessageView, provide visual indication of Flagged and
Answered states.
2009-01-13 05:52:37 +00:00
Daniel Applebaum 1f9bf1ec50 Issues 199 & 201
No fixes, just extra details in thrown Exceptions to try to track down
problems.
2009-01-09 05:42:59 +00:00
Daniel Applebaum d0a354ead0 Delete needs to know how to use Imap prefix 2009-01-09 05:01:05 +00:00
Daniel Applebaum 3a3dc2da43 Instant deletes from FolderMessageList. Faster deletes from
MessageView

Deleting a message in Trash deletes it for real (permanently)

All message operations are allowed on messages in the Outbox.  Special
handling for deleting, so that the message is copied to Trash, then
copied asynchronously to the remote Trash.

Add some more items to the hotkey help
2009-01-07 06:02:04 +00:00
Daniel Applebaum 334d64141f Complete merge of DAmail functionality into K9mail. Following
features are added to K9mail:

1) Show unread message count on each folder
2) Sum unread count of all shown folders in an account to the account display
3) Periodically check selected folders for new mail, not just Inbox
4) Don't refresh folder when opened (unless folder is empty)
5) Show date and time of last sync for each folder
6) Fix timer for automatic periodic sync (use wakelock to assure completion)
7) Optimize local folder queries (speeds up account and folder lists)
8) Show Loading... message in status bar indicating which folder is being synced
9) Eliminate redundant sync of new messages (performance enhancement)
10) Improve notification text for multiple accounts
11) Do not automatically sync folders more often than the account-specific period
12) Use user-configured date and time formats
13) Select which folders are shown, using configurable Classes
14) Select which folders are synced, using configurable Classes
15) Added context (long press) menu to folders, to provide for Refresh
and Folder Settings
16) Status light flashes purple when there are unread messages
17) Folder list more quickly eliminates display of deleted and out-of-Class folders.
18) Delete works 
19) Mark all messages as read (in the folder context menu)
20) Notifications only for new unread messages
21) One minute synchronization frequency
22) Deleting an unread message decrements unread counter
23) Notifications work for POP3 accounts
24) Message deletes work for POP3 accounts
25) Explicit errors show in folder list
26) Stack traces saved to folder K9mail-errors
27) Clear pending actions (danger, for emergencies only!)
28) Delete policy in Account settings
29) DNS cache in InetAddress disabled
30) Trapped some crash-causing error conditions
31) Eliminate duplicate copies to Sent folder
32) Prevent crashes due to message listener concurrency
33) Empty Trash
34) Nuclear "Mark all messages as read" (marks all messages as read in
server-side folder, irrespective of which messages have been downloaded)
35) Forward (alternate) to allow forwarding email through other programs
36) Accept text/plain Intents to allow other programs to send email through K9mail
37) Displays Outbox sending status
38) Manual retry of outbox sending when "Refresh"ing Outbox
39) Folder error status is persisted
40) Ability to log to arbitrary file

Fixes K9 issues 11, 23, 24, 65, 69, 71, 79, 81, 82, 83, 87, 101, 104,
107, 120, 148, 154
2008-12-31 03:49:09 +00:00
Jesse Vincent 28e8827827 Even more progressive rename/unfork work 2008-12-16 23:34:01 +00:00
Jesse Vincent ac55d3034b oops 2008-12-16 23:09:23 +00:00