Added no junk folder error message

pull/184/head
M66B 4 years ago
parent 65e40f5877
commit deefc33d9e

@ -6394,7 +6394,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
EntityFolder junk = db.folder().getFolderByType(message.account, EntityFolder.JUNK);
if (junk == null)
return null;
throw new IllegalArgumentException(context.getString(R.string.title_no_junk_folder));
EntityOperation.queue(context, message, EntityOperation.MOVE, junk.id);
@ -6404,7 +6404,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
rule.id = db.rule().insertRule(rule);
}
db.setTransactionSuccessful();
} finally {
db.endTransaction();
@ -6417,7 +6416,17 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override
protected void onException(Bundle args, Throwable ex) {
Log.unexpectedError(getParentFragmentManager(), ex);
if (ex instanceof IllegalArgumentException) {
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_INDEFINITE);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(getContext(), ActivitySetup.class));
}
});
snackbar.show();
} else
Log.unexpectedError(getParentFragmentManager(), ex);
}
}.execute(this, args, "message:junk");
}

@ -639,6 +639,7 @@
<string name="title_no_password">Password missing</string>
<string name="title_no_inbox">Inbox not found</string>
<string name="title_no_primary_drafts">No primary account or no drafts folder</string>
<string name="title_no_junk_folder">There is no spam folder selected for this account</string>
<string name="title_no_identities">Sending emails requires at least one identity and a drafts folder</string>
<string name="title_no_standard">This provider uses a proprietary email protocol and therefore it is not possible to use third party email clients</string>
<string name="title_no_idle">This provider does not support push messages. This will delay reception of new messages and increase battery usage.</string>

Loading…
Cancel
Save