mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-04 16:16:33 +02:00
Check if folders are actually alive
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user