diff --git a/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java b/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java index 56b26d036..e3f7af1bc 100644 --- a/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java +++ b/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java @@ -1070,7 +1070,7 @@ public class MessagingController { Timber.i("Marking all messages in %s:%s as read", account, folderServerId); // TODO: Make this one database UPDATE operation - List messages = localFolder.getMessages(null, false); + List messages = localFolder.getMessages(false); for (Message message : messages) { if (!message.isSet(Flag.SEEN)) { message.setFlag(Flag.SEEN, true); @@ -1539,7 +1539,7 @@ public class MessagingController { long outboxFolderId = localFolder.getDatabaseId(); - List localMessages = localFolder.getMessages(null); + List localMessages = localFolder.getMessages(); int progress = 0; int todo = localMessages.size(); for (MessagingListener l : getListeners()) { diff --git a/app/core/src/main/java/com/fsck/k9/mailstore/LocalFolder.java b/app/core/src/main/java/com/fsck/k9/mailstore/LocalFolder.java index 02b508d7c..bed0363b4 100644 --- a/app/core/src/main/java/com/fsck/k9/mailstore/LocalFolder.java +++ b/app/core/src/main/java/com/fsck/k9/mailstore/LocalFolder.java @@ -576,17 +576,16 @@ public class LocalFolder { }); } - public List getMessages(MessageRetrievalListener listener) throws MessagingException { - return getMessages(listener, true); + public List getMessages() throws MessagingException { + return getMessages(true); } - public List getMessages(final MessageRetrievalListener listener, - final boolean includeDeleted) throws MessagingException { + public List getMessages(final boolean includeDeleted) throws MessagingException { return localStore.getDatabase().execute(false, new DbCallback>() { @Override public List doDbWork(final SQLiteDatabase db) throws MessagingException { open(); - return LocalFolder.this.localStore.getMessages(listener, LocalFolder.this, + return LocalFolder.this.localStore.getMessages(null, LocalFolder.this, "SELECT " + LocalStore.GET_MESSAGES_COLS + "FROM messages " + "LEFT JOIN message_parts ON (message_parts.id = messages.message_part_id) " + @@ -898,7 +897,7 @@ public class LocalFolder { public void setFlags(final Set flags, boolean value) throws MessagingException { open(); - for (LocalMessage message : getMessages(null)) { + for (LocalMessage message : getMessages()) { message.setFlags(flags, value); } } diff --git a/app/core/src/test/java/com/fsck/k9/controller/MessagingControllerTest.java b/app/core/src/test/java/com/fsck/k9/controller/MessagingControllerTest.java index 6fad0313b..7896c2c37 100644 --- a/app/core/src/test/java/com/fsck/k9/controller/MessagingControllerTest.java +++ b/app/core/src/test/java/com/fsck/k9/controller/MessagingControllerTest.java @@ -419,7 +419,7 @@ public class MessagingControllerTest extends K9RobolectricTest { when(localStore.getFolder(SENT_FOLDER_ID)).thenReturn(sentFolder); when(sentFolder.getDatabaseId()).thenReturn(SENT_FOLDER_ID); when(localFolder.exists()).thenReturn(true); - when(localFolder.getMessages(null)).thenReturn(Collections.singletonList(localMessageToSend1)); + when(localFolder.getMessages()).thenReturn(Collections.singletonList(localMessageToSend1)); when(localMessageToSend1.getUid()).thenReturn("localMessageToSend1"); when(localMessageToSend1.getDatabaseId()).thenReturn(42L); when(localMessageToSend1.getHeader(K9.IDENTITY_HEADER)).thenReturn(new String[]{});