remoteStore assocciated with account indirectly should also be reseted when acccount was removed. Otherwise, there might be residual data that will affec account being added later.
This commit is contained in:
parent
917da8cd90
commit
50a8d89468
2 changed files with 16 additions and 0 deletions
|
@ -123,6 +123,14 @@ public class Preferences {
|
|||
accountsInOrder.remove(account);
|
||||
}
|
||||
|
||||
try {
|
||||
account.getRemoteStore().resetRemoteStore(account);
|
||||
} catch (MessagingException e) {
|
||||
Log.e(K9.LOG_TAG, "Failed to reset remote store for account "
|
||||
+ account.getUuid());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
account.delete(this);
|
||||
|
||||
if (newAccount == account) {
|
||||
|
|
|
@ -209,5 +209,13 @@ public abstract class Store {
|
|||
return mAccount;
|
||||
}
|
||||
|
||||
public void resetRemoteStore(Account account) {
|
||||
String uri = account.getStoreUri();
|
||||
if (uri.startsWith("local")) {
|
||||
throw new RuntimeException(
|
||||
"Asked to get non-local Store object but given LocalStore URI");
|
||||
}
|
||||
sStores.remove(uri);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue