1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 11:15:51 +00:00

Check if folders are actually alive

This commit is contained in:
M66B 2020-04-17 16:34:43 +02:00
parent d87fb53960
commit 72ede04868
2 changed files with 11 additions and 1 deletions

View file

@ -586,6 +586,16 @@ class Core {
});
}
static boolean isAlive(IMAPFolder ifolder) {
try {
noop(ifolder);
} catch (MessagingException ex) {
Log.i(ifolder.getFullName(), ex);
return false;
}
return true;
}
private static void onSeen(Context context, JSONArray jargs, EntityFolder folder, EntityMessage message, IMAPFolder ifolder) throws MessagingException, JSONException {
// Mark message (un)seen
DB db = DB.getInstance(context);

View file

@ -1346,7 +1346,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if (folder.synchronize)
if (!folder.poll && capIdle) {
// Sends folder NOOP
if (!mapFolders.get(folder).isOpen())
if (!Core.isAlive(mapFolders.get(folder)))
throw new StoreClosedException(iservice.getStore(), folder.name);
} else {
if (folder.poll_count == 0)