Remove unused message counts from MessagingListener.synchronizeMailboxFinished()

This commit is contained in:
cketti 2020-01-22 17:16:06 +01:00
parent aeef338efd
commit b99d445736
12 changed files with 15 additions and 27 deletions

View file

@ -39,8 +39,7 @@ class MemorizingMessagingListener extends SimpleMessagingListener {
syncStarted = memory;
break;
case FINISHED:
other.synchronizeMailboxFinished(memory.account, memory.folderServerId,
memory.syncingTotalMessagesInMailbox, memory.syncingNumNewMessages);
other.synchronizeMailboxFinished(memory.account, memory.folderServerId);
break;
case FAILED:
other.synchronizeMailboxFailed(memory.account, memory.folderServerId,
@ -74,12 +73,9 @@ class MemorizingMessagingListener extends SimpleMessagingListener {
}
@Override
public synchronized void synchronizeMailboxFinished(Account account, String folderServerId,
int totalMessagesInMailbox, int numNewMessages) {
public synchronized void synchronizeMailboxFinished(Account account, String folderServerId) {
Memory memory = getMemory(account, folderServerId);
memory.syncingState = MemorizingState.FINISHED;
memory.syncingTotalMessagesInMailbox = totalMessagesInMailbox;
memory.syncingNumNewMessages = numNewMessages;
}
@Override
@ -121,9 +117,6 @@ class MemorizingMessagingListener extends SimpleMessagingListener {
MemorizingState syncingState = null;
String failureMessage = null;
int syncingTotalMessagesInMailbox;
int syncingNumNewMessages;
int folderCompleted = 0;
int folderTotal = 0;

View file

@ -2989,10 +2989,9 @@ public class MessagingController {
}
@Override
public void syncFinished(@NotNull String folderServerId, int totalMessagesInMailbox, int numNewMessages) {
public void syncFinished(@NotNull String folderServerId) {
for (MessagingListener messagingListener : getListeners(listener)) {
messagingListener.synchronizeMailboxFinished(account, folderServerId, totalMessagesInMailbox,
numNewMessages);
messagingListener.synchronizeMailboxFinished(account, folderServerId);
}
}

View file

@ -47,8 +47,7 @@ public class MessagingControllerPushReceiver implements PushReceiver {
final CountDownLatch latch = new CountDownLatch(1);
controller.synchronizeMailbox(account, folderServerId, new SimpleMessagingListener() {
@Override
public void synchronizeMailboxFinished(Account account, String folderServerId,
int totalMessagesInMailbox, int numNewMessages) {
public void synchronizeMailboxFinished(Account account, String folderServerId) {
latch.countDown();
}

View file

@ -26,7 +26,7 @@ public interface MessagingListener {
void synchronizeMailboxProgress(Account account, String folderServerId, int completed, int total);
void synchronizeMailboxNewMessage(Account account, String folderServerId, Message message);
void synchronizeMailboxRemovedMessage(Account account, String folderServerId, String messageServerId);
void synchronizeMailboxFinished(Account account, String folderServerId, int totalMessagesInMailbox, int numNewMessages);
void synchronizeMailboxFinished(Account account, String folderServerId);
void synchronizeMailboxFailed(Account account, String folderServerId, String message);
void loadMessageRemoteFinished(Account account, String folderServerId, String uid);

View file

@ -55,8 +55,7 @@ public abstract class SimpleMessagingListener implements MessagingListener {
}
@Override
public void synchronizeMailboxFinished(Account account, String folderServerId, int totalMessagesInMailbox,
int numNewMessages) {
public void synchronizeMailboxFinished(Account account, String folderServerId) {
}
@Override

View file

@ -1227,9 +1227,7 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
}
@Override
public void synchronizeMailboxFinished(Account account, String folderServerId, int totalMessagesInMailbox,
int numNewMessages) {
public void synchronizeMailboxFinished(Account account, String folderServerId) {
if (updateForMe(account, folderServerId)) {
handler.progress(false);
handler.folderLoading(folderServerId, false);

View file

@ -14,7 +14,7 @@ interface SyncListener {
fun syncRemovedMessage(folderServerId: String, messageServerId: String)
fun syncFlagChanged(folderServerId: String, messageServerId: String)
fun syncFinished(folderServerId: String, totalMessagesInMailbox: Int, numNewMessages: Int)
fun syncFinished(folderServerId: String)
fun syncFailed(folderServerId: String, message: String, exception: Exception?)
fun folderStatusChanged(folderServerId: String)

View file

@ -214,7 +214,7 @@ class ImapSync {
System.currentTimeMillis(),
newMessages);
listener.syncFinished(folder, remoteMessageCount, newMessages);
listener.syncFinished(folder);
Timber.i("Done synchronizing folder %s:%s", accountName, folder);

View file

@ -12,7 +12,7 @@ class SimpleSyncListener : SyncListener {
override fun syncNewMessage(folderServerId: String, messageServerId: String, isOldMessage: Boolean) = Unit
override fun syncRemovedMessage(folderServerId: String, messageServerId: String) = Unit
override fun syncFlagChanged(folderServerId: String, messageServerId: String) = Unit
override fun syncFinished(folderServerId: String, totalMessagesInMailbox: Int, numNewMessages: Int) = Unit
override fun syncFinished(folderServerId: String) = Unit
override fun syncFailed(folderServerId: String, message: String, exception: Exception?) = Unit
override fun folderStatusChanged(folderServerId: String) = Unit
}

View file

@ -90,7 +90,7 @@ public class ImapSyncTest {
imapSync.sync(FOLDER_NAME, syncConfig, listener);
verify(listener).syncFinished(FOLDER_NAME, 1, 0);
verify(listener).syncFinished(FOLDER_NAME);
}
@Test
@ -99,7 +99,7 @@ public class ImapSyncTest {
imapSync.sync(FOLDER_NAME, syncConfig, listener);
verify(listener).syncFinished(FOLDER_NAME, 0, 0);
verify(listener).syncFinished(FOLDER_NAME);
}
@Test

View file

@ -209,7 +209,7 @@ class Pop3Sync {
System.currentTimeMillis(),
newMessages);
listener.syncFinished(folder, remoteMessageCount, newMessages);
listener.syncFinished(folder);
Timber.i("Done synchronizing folder %s:%s", accountName, folder);

View file

@ -209,7 +209,7 @@ class WebDavSync {
System.currentTimeMillis(),
newMessages);
listener.syncFinished(folder, remoteMessageCount, newMessages);
listener.syncFinished(folder);
Timber.i("Done synchronizing folder %s:%s", accountName, folder);