Loading src/com/fsck/k9/controller/MessagingController.java +10 −4 Original line number Diff line number Diff line Loading @@ -1005,13 +1005,19 @@ public class MessagingController implements Runnable { * Remove any messages that are in the local store but no longer on the remote store or are too old */ if (account.syncRemoteDeletions()) { ArrayList<Message> destroyMessages = new ArrayList<Message>(); for (Message localMessage : localMessages) { if (remoteUidMap.get(localMessage.getUid()) == null) { localMessage.destroy(); destroyMessages.add(localMessage); } } localFolder.destroyMessages(destroyMessages.toArray(EMPTY_MESSAGE_ARRAY)); for (Message destroyMessage : destroyMessages) { for (MessagingListener l : getListeners(listener)) { l.synchronizeMailboxRemovedMessage(account, folder, localMessage); } l.synchronizeMailboxRemovedMessage(account, folder, destroyMessage); } } } Loading src/com/fsck/k9/mail/store/LocalStore.java +21 −0 Original line number Diff line number Diff line Loading @@ -2020,6 +2020,27 @@ public class LocalStore extends Store implements Serializable { appendMessages(messages, false); } public void destroyMessages(final Message[] messages) throws MessagingException { try { database.execute(true, new DbCallback<Void>() { @Override public Void doDbWork(final SQLiteDatabase db) throws WrappedException, UnavailableStorageException { for (Message message : messages) { try { message.destroy(); } catch (MessagingException e) { throw new WrappedException(e); } } return null; } }); } catch (MessagingException e) { throw new WrappedException(e); } } /** * The method differs slightly from the contract; If an incoming message already has a uid * assigned and it matches the uid of an existing message then this message will replace the Loading Loading
src/com/fsck/k9/controller/MessagingController.java +10 −4 Original line number Diff line number Diff line Loading @@ -1005,13 +1005,19 @@ public class MessagingController implements Runnable { * Remove any messages that are in the local store but no longer on the remote store or are too old */ if (account.syncRemoteDeletions()) { ArrayList<Message> destroyMessages = new ArrayList<Message>(); for (Message localMessage : localMessages) { if (remoteUidMap.get(localMessage.getUid()) == null) { localMessage.destroy(); destroyMessages.add(localMessage); } } localFolder.destroyMessages(destroyMessages.toArray(EMPTY_MESSAGE_ARRAY)); for (Message destroyMessage : destroyMessages) { for (MessagingListener l : getListeners(listener)) { l.synchronizeMailboxRemovedMessage(account, folder, localMessage); } l.synchronizeMailboxRemovedMessage(account, folder, destroyMessage); } } } Loading
src/com/fsck/k9/mail/store/LocalStore.java +21 −0 Original line number Diff line number Diff line Loading @@ -2020,6 +2020,27 @@ public class LocalStore extends Store implements Serializable { appendMessages(messages, false); } public void destroyMessages(final Message[] messages) throws MessagingException { try { database.execute(true, new DbCallback<Void>() { @Override public Void doDbWork(final SQLiteDatabase db) throws WrappedException, UnavailableStorageException { for (Message message : messages) { try { message.destroy(); } catch (MessagingException e) { throw new WrappedException(e); } } return null; } }); } catch (MessagingException e) { throw new WrappedException(e); } } /** * The method differs slightly from the contract; If an incoming message already has a uid * assigned and it matches the uid of an existing message then this message will replace the Loading