Added large draft warning

pull/214/head
M66B 1 year ago
parent c8bf76816a
commit be59e4d581

@ -326,6 +326,7 @@ public class FragmentCompose extends FragmentBase {
private static final int COPY_ATTACHMENT_TIMEOUT = 60; // seconds
private static final int MAX_QUOTE_LEVEL = 5;
private static final int MAX_REASONABLE_SIZE = 5 * 1024 * 1024;
private static final int REQUEST_CONTACT_TO = 1;
private static final int REQUEST_CONTACT_CC = 2;
@ -6922,7 +6923,10 @@ public class FragmentCompose extends FragmentBase {
}
}
Helper.writeText(draft.getFile(context), body);
File f = draft.getFile(context);
Helper.writeText(f, body);
if (f.length() > MAX_REASONABLE_SIZE)
args.putBoolean("large", true);
String full = HtmlHelper.getFullText(body);
draft.preview = HtmlHelper.getPreview(full);
@ -7296,6 +7300,9 @@ public class FragmentCompose extends FragmentBase {
bottom_navigation.getMenu().findItem(R.id.action_undo).setVisible(draft.revision > 1);
bottom_navigation.getMenu().findItem(R.id.action_redo).setVisible(draft.revision < draft.revisions);
if (args.getBoolean("large"))
ToastEx.makeText(getContext(), R.string.title_large_body, Toast.LENGTH_LONG).show();
if (args.getBundle("extras").getBoolean("silent")) {
etBody.setTag(null);
return;

@ -2237,6 +2237,7 @@
<string name="title_no_ask_again">Do not ask this again</string>
<string name="title_no_ask_for_again">Do not ask this again for %1$s</string>
<string name="title_no_body">No message text found</string>
<string name="title_large_body">This message is very large and this may cause problems!</string>
<string name="title_no_charset">Unsupported encoding: %1$s</string>
<string name="title_via">Via: %1$s</string>
<string name="title_1hour">1 hour</string>

Loading…
Cancel
Save