Commit Graph

276 Commits

Author SHA1 Message Date
Jesse Vincent e74bd74909 Fix for market-reported NPE:
java.lang.NullPointerException
at com.fsck.k9.controller.MessagingController.actOnMessages(MessagingController.java:5602)
at com.fsck.k9.controller.MessagingController.deleteThreads(MessagingController.java:3986)
at com.fsck.k9.fragment.MessageListFragment.onDelete(MessageListFragment.java:1311)
at com.fsck.k9.fragment.MessageListFragment.onDelete(MessageListFragment.java:1306)
at com.fsck.k9.fragment.MessageListFragment.onContextItemSelected(MessageListFragment.java:1506)
at android.support.v4.app.Fragment.performContextItemSelected(Fragment.java:1583)
at android.support.v4.app.FragmentManagerImpl.dispatchContextItemSelected(FragmentManager.java:1992)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:370)
at com.actionbarsherlock.app.SherlockFragmentActivity.onMenuItemSelected(SherlockFragmentActivity.java:211)
at com.android.internal.policy.impl.PhoneWindow$DialogMenuCallback.onMenuItemSelected(PhoneWindow.java:4038)
at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
at com.android.internal.view.menu.MenuDialogHelper.onClick(MenuDialogHelper.java:193)
at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:934)
at android.widget.AdapterView.performItemClick(AdapterView.java:301)
at android.widget.AbsListView.performItemClick(AbsListView.java:1287)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:3078)
at android.widget.AbsListView$1.run(AbsListView.java:4161)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
2013-07-21 15:55:18 -04:00
Jesse Vincent 5cec9e175b Replace synchronous setting of a flag with async setting of the flag. This helps speed up message display time (anecdotally) 2013-07-18 20:27:16 -04:00
Jesse Vincent b27ffcf502 Marking a message as read in the database is currently very expensive, especially if you have threading enabled.
Defer that until _after_ telling listeners that they're cool to show the message
2013-07-18 20:26:54 -04:00
cketti 916489ad9d Don't load unread/flagged count when creating LocalFolder instances
This avoids a potentially expensive LEFT JOIN when querying the database.
2013-07-08 04:50:30 +02:00
cketti 876d4d61df Don't use extended notifications when privacy mode is enabled 2013-06-27 19:25:21 +02:00
cketti e15409bafa Don't show ALL unread messages for "notification opens unread messages" 2013-04-18 22:06:33 +02:00
cketti 33a2b05701 Get rid of accidentally created "-NONE-" folder 2013-03-31 01:13:09 +01:00
cketti 94b5758eea Use cache when marking message as read on view 2013-03-18 17:53:18 +01:00
cketti a364d6262d Fix cache cleanup 2013-03-18 17:44:33 +01:00
Danny Baumann 538b81b6ec Make notification task back stack consistent to activity flow.
Fixes #4956.
2013-03-15 13:25:25 +01:00
Danny Baumann 195686cbd6 Fix NPE when clicking on a notification with >= 2 messages on SDK < 16.
Seemingly the intents in the task back stack got confused when the
pending intent was updated in those versions (the Accounts intent was
delivered to MessageList). Avoid that by not updating the current
intent, but dropping the old one.

Fixes issue #4955.
2013-03-15 12:48:04 +01:00
Danny Baumann 3ff522c9c4 Include a full activity back stack when building notification intents. 2013-03-13 11:03:51 +01:00
cketti 625c5f1874 Fix "Empty trash" functionality for POP3 accounts
Previously messages in the local Trash folder were marked as deleted,
then deleted from the server. During the next sync the placeholders for
deleted messages are removed from the database.
Obviously this doesn't work for POP3 accounts because the Trash folder
can't be synchronized with the server. So, for POP3, we now immediately
clear out all messages in that folder.
2013-03-10 21:45:36 +01:00
cketti 207e2a1e56 Notification icon update
Android 2.2: use old icon
Android 2.3: new icon, (try to) follow icon guidelines for 2.3
Android 3.0+: new icon, follow guidelines for 3.0+

See http://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar.html
2013-02-26 20:34:52 +01:00
cketti 906163b538 Use correct string for notification title 2013-02-21 05:42:04 +01:00
cketti 92c21ece6d Fix showing unread count in pre-Honeycomb notifications
Fixes issue 4904
2013-02-20 23:55:46 +01:00
cketti 50fcff76fd Add a caching layer to EmailProvider
Database updates can be surprisingly slow. This lead to slow updates of
the user interface which in turn made working with K-9 Mail not as fun
as it should be. This commit hopefully changes that.
2013-02-19 04:45:14 +01:00
cketti 73ab6ba719 Add animated notification icon for "check mail" 2013-02-11 01:31:56 +01:00
cketti 74bbbe7ea5 Fix not marking messages as read on viewing 2013-02-06 17:38:10 +01:00
Danny Baumann 275700e482 Fix a number of build warnings.
This gets rid of about 50 warnings. Deprecation warnings still remain,
though.
2013-02-04 11:18:49 +01:00
Danny Baumann 5d1e42c453 Improve certificate failure notifications.
The commit that introduced those notifications also introduced a rather
... interesting design pattern: The CertificateValidationException
notified the user of its pure existance - it's no longer a 'message'
only, but defines policy. As this is more than unusual, replace this
pattern by the MessagingController treating
CertificateValidationException specially when accessing remote folders.

Also make clear which account failed when constructing the notification.
2013-02-02 13:04:41 +01:00
cketti af51eee9b1 Get rid of MessageView activity 2013-01-31 04:34:23 +01:00
Samuel Sieb edc0c0dc5e load the correct number of extra messages from the server instead of possibly doubling the count 2013-01-16 12:24:43 -08:00
Jesse Vincent 841e565a49 Merge remote-tracking branch 'zjw/progress_indicators'
* zjw/progress_indicators:
  Provide a progress indicator while loading remote search results.
  Remove the progress bar from the message list footer.
  Provide progress indicator for searches.

Conflicts:
	src/com/fsck/k9/activity/MessageList.java
2013-01-15 15:06:23 -05:00
Jesse Vincent ae6c7e37ca Merge remote-tracking branch 'zjw/issue_2389_cert_error_notice2'
* zjw/issue_2389_cert_error_notice2:
  Fix Issue 2389:  Self signed certificate expiry causes silent send/receive failure.
2013-01-15 14:44:21 -05:00
Andrew Chen bdf2283ef4 Merge pull request #225 from maniac103/fix-multiaccount-notification
Fix notification click behaviour for multiple accounts.
2013-01-14 15:14:06 -08:00
Joe Steele f3084dbb66 Provide a progress indicator while loading remote search results. 2013-01-12 18:02:09 -05:00
cketti 543fefebaa Merge branch 'threading_schema_change' 2013-01-12 23:03:38 +01:00
cketti 421558c148 Optimize setting flags for whole threads 2013-01-12 02:28:12 +01:00
cketti 1df88ea153 Use separate table to store the thread structure 2013-01-11 03:40:35 +01:00
Joe Steele 29f15d715d Fix Issue 2389: Self signed certificate expiry causes silent send/receive failure.
With this fix, a CertPathValidatorException or CertificateException will
create a "Certificate error:  Check your server settings" notification
in the status bar.  When the user clicks on the notification, they are
taken to the appropriate server settings screen where they can review their
settings and can accept a different server certificate.
2013-01-10 16:49:55 -05:00
Danny Baumann 3d14bd53f1 Fix notification click behaviour for multiple accounts.
Test case:
- Have two accounts A and B
- Get a mail on A
- Get a mail on B
- Click on the notification for A

Result:
You end up seeing the message from B instead of A

The reason for that is that we need to register separate PendingIntents
for each account.
2013-01-10 09:45:37 +01:00
Danny Baumann ada2a9ccb5 Documentation and cleanup
- Add Javadoc to new methods and classes
- Get rid of magic number
2013-01-08 12:52:56 +01:00
Danny Baumann 4d075c91ac Some more cleanup
- When the last message of the message list is cleared, clear the whole
  notification
- Compare whole message reference, not only UID.
2013-01-08 10:06:01 +01:00
Danny Baumann 84a5e34537 Improve notification message list processing
- If a message contained in the inbox list is deleted or read while
  there are messages in the overflow list, restore the newest message
  from the overflow list so there are always 5 messages in the inbox
  list in that case.
- Use explicit methods instead of method overriding.
2013-01-08 09:27:28 +01:00
Andrew Chen 5ac3d1d5c2 Use existing LocalMessage for the JB notifications.
LocalMessage already has a content preview in it; reuse that.
Remove unneeded MimeMessage#getPreview() method now that we don't need
to generate a preview anymore.
2013-01-07 23:20:35 -08:00
Andrew Chen e32909c57a Remove unused import 2013-01-07 20:51:37 -08:00
Andrew Chen 1ff0bb6289 Merge pull request #222 from maniac103/jb-notifications
Merge branch 'jb-notifications' of https://github.com/maniac103/k-9

* 'jb-notifications' of https://github.com/maniac103/k-9:
  Strip off signatures from preview.
  Reset list of unseen messages when the user clears the notification.
  In the new-style notification, directly go to message if new message count is 1.
  Cancel notification when viewing message by clicking on notification.
  Directly go to message when clicking on a single-message notification.
  Fix message overflow.
  Incorporate review comments.
  Some fixes to notification behaviour.
  Add German translation for message delete notification action.
  Add delete action to notification.
  Update summarized notification if a message is deleted or read remotely.
  Fixed deprecation warnings.
  Simplify code and beautify pre-jellybean notifications by using bold sender span for those.
  Respect "Show contact names" option when determining sender for notification.
  Fix marking messages as read from notification.
  Add German translation for new strings.
  Add actions to notifications.
  First stab at new notifications.
  Remove own Notification.Builder abstraction.
  Update android support library to latest version.
2013-01-07 20:44:35 -08:00
Danny Baumann 7e1e38189d Reset list of unseen messages when the user clears the notification. 2013-01-07 09:12:07 +01:00
Andrew Chen d7d562bd58 Fetch the simple name of the class instead of doing regex dances. 2013-01-06 12:40:03 -08:00
Danny Baumann aaa65a457e In the new-style notification, directly go to message if new message
count is 1.

This matches what is displayed in the notification itself.
2013-01-06 12:16:54 +01:00
Danny Baumann e17e9b9344 Cancel notification when viewing message by clicking on notification. 2013-01-06 12:13:36 +01:00
Danny Baumann ef93f0af6c Directly go to message when clicking on a single-message notification. 2013-01-05 14:15:15 +01:00
Danny Baumann d9cc0446b6 Fix message overflow. 2013-01-05 13:59:16 +01:00
Danny Baumann 6f7ec3e401 Incorporate review comments. 2013-01-05 13:21:17 +01:00
Danny Baumann b334960355 Some fixes to notification behaviour.
- Make notification high priority if any previewed message is flagged
- Fix message ordering
- Go to folder list instead of folder of newest message if there are
  multiple messages in the notification
2013-01-04 16:52:47 +01:00
Danny Baumann 0bf3dddafc Add delete action to notification. 2013-01-04 10:40:48 +01:00
Danny Baumann 220a2da195 Update summarized notification if a message is deleted or read remotely. 2013-01-03 10:14:22 +01:00
Danny Baumann 3e0cbb1bb6 Fixed deprecation warnings. 2013-01-03 09:39:02 +01:00
Andrew Chen 1767c3428e If we have to surface Java exceptions to the user, make them more readable. 2013-01-02 21:38:01 -08:00