1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-23 14:41:08 +00:00

Refactoring

This commit is contained in:
M66B 2019-10-28 18:50:39 +01:00
parent 406541f9ef
commit ca13b2ff67

View file

@ -221,7 +221,10 @@ public class Log {
return false;
Throwable ex = report.getError().getException();
return shouldNotify(ex);
}
private boolean shouldNotify(Throwable ex) {
if (ex instanceof MessagingException &&
(ex.getCause() instanceof IOException ||
ex.getCause() instanceof ProtocolException))
@ -250,13 +253,10 @@ public class Log {
return false;
// Rate limit
int count = prefs.getInt("crash_report_count", 0);
count++;
int count = prefs.getInt("crash_report_count", 0) + 1;
prefs.edit().putInt("crash_report_count", count).apply();
if (count > MAX_CRASH_REPORTS)
return false;
return true;
return (count <= MAX_CRASH_REPORTS);
}
});