Remove unnecessary method parameters
This commit is contained in:
parent
f59976ada2
commit
065f98cfdd
3 changed files with 8 additions and 9 deletions
|
@ -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<LocalMessage> messages = localFolder.getMessages(null, false);
|
||||
List<LocalMessage> 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<LocalMessage> localMessages = localFolder.getMessages(null);
|
||||
List<LocalMessage> localMessages = localFolder.getMessages();
|
||||
int progress = 0;
|
||||
int todo = localMessages.size();
|
||||
for (MessagingListener l : getListeners()) {
|
||||
|
|
|
@ -576,17 +576,16 @@ public class LocalFolder {
|
|||
});
|
||||
}
|
||||
|
||||
public List<LocalMessage> getMessages(MessageRetrievalListener<LocalMessage> listener) throws MessagingException {
|
||||
return getMessages(listener, true);
|
||||
public List<LocalMessage> getMessages() throws MessagingException {
|
||||
return getMessages(true);
|
||||
}
|
||||
|
||||
public List<LocalMessage> getMessages(final MessageRetrievalListener<LocalMessage> listener,
|
||||
final boolean includeDeleted) throws MessagingException {
|
||||
public List<LocalMessage> getMessages(final boolean includeDeleted) throws MessagingException {
|
||||
return localStore.getDatabase().execute(false, new DbCallback<List<LocalMessage>>() {
|
||||
@Override
|
||||
public List<LocalMessage> 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<Flag> flags, boolean value)
|
||||
throws MessagingException {
|
||||
open();
|
||||
for (LocalMessage message : getMessages(null)) {
|
||||
for (LocalMessage message : getMessages()) {
|
||||
message.setFlags(flags, value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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[]{});
|
||||
|
|
Loading…
Reference in a new issue