|
|
|
@ -25,7 +25,6 @@ import android.util.Log;
|
|
|
|
|
import com.sun.mail.imap.IMAPFolder;
|
|
|
|
|
import com.sun.mail.imap.IMAPMessage;
|
|
|
|
|
import com.sun.mail.imap.IMAPStore;
|
|
|
|
|
import com.sun.mail.util.FolderClosedIOException;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
@ -133,6 +132,7 @@ public class ViewModelBrowse extends ViewModel {
|
|
|
|
|
|
|
|
|
|
EntityAccount account = db.account().getAccount(folder.account);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
Properties props = MessageHelper.getSessionProperties(account.auth_type, account.insecure);
|
|
|
|
|
props.setProperty("mail.imap.throwsearchexception", "true");
|
|
|
|
|
Session isession = Session.getInstance(props, null);
|
|
|
|
@ -167,6 +167,14 @@ public class ViewModelBrowse extends ViewModel {
|
|
|
|
|
Log.i(Helper.TAG, "Boundary found messages=" + state.imessages.length);
|
|
|
|
|
|
|
|
|
|
state.index = state.imessages.length - 1;
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
if (ex instanceof FolderClosedException)
|
|
|
|
|
Log.w(Helper.TAG, "Search " + ex + "\n" + Log.getStackTraceString(ex));
|
|
|
|
|
else {
|
|
|
|
|
Log.e(Helper.TAG, "Search " + ex + "\n" + Log.getStackTraceString(ex));
|
|
|
|
|
throw ex;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int count = 0;
|
|
|
|
@ -202,9 +210,7 @@ public class ViewModelBrowse extends ViewModel {
|
|
|
|
|
}
|
|
|
|
|
db.message().setMessageFound(message.account, message.thread);
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
if ((ex instanceof MessageRemovedException) ||
|
|
|
|
|
(ex instanceof FolderClosedException) ||
|
|
|
|
|
(ex instanceof FolderClosedIOException))
|
|
|
|
|
if ((ex instanceof MessageRemovedException) || (ex instanceof FolderClosedException))
|
|
|
|
|
Log.w(Helper.TAG, "Boundary " + ex + "\n" + Log.getStackTraceString(ex));
|
|
|
|
|
else {
|
|
|
|
|
Log.e(Helper.TAG, "Boundary " + ex + "\n" + Log.getStackTraceString(ex));
|
|
|
|
|