Workaround Open-Xchange bug

This commit is contained in:
M66B 2019-03-30 18:45:54 +01:00
parent b98287e68a
commit bdf8f43628
1 changed files with 10 additions and 1 deletions

View File

@ -813,7 +813,16 @@ class Core {
searchTerm = new OrTerm(searchTerm, new FlagTerm(new Flags(Flags.Flag.FLAGGED), true)); searchTerm = new OrTerm(searchTerm, new FlagTerm(new Flags(Flags.Flag.FLAGGED), true));
long search = SystemClock.elapsedRealtime(); long search = SystemClock.elapsedRealtime();
Message[] imessages = ifolder.search(searchTerm); Message[] imessages;
try {
imessages = ifolder.search(searchTerm);
} catch (MessagingException ex) {
if (ifolder.getPermanentFlags().contains(Flags.Flag.FLAGGED)) {
Log.w(ex.getMessage());
imessages = ifolder.search(new ReceivedDateTerm(ComparisonTerm.GE, new Date(sync_time)));
} else
throw ex;
}
Log.i(folder.name + " remote count=" + imessages.length + Log.i(folder.name + " remote count=" + imessages.length +
" search=" + (SystemClock.elapsedRealtime() - search) + " ms"); " search=" + (SystemClock.elapsedRealtime() - search) + " ms");