Send improvements

pull/212/head
M66B 1 year ago
parent 4656b65489
commit bbe50830dd

@ -72,7 +72,7 @@ public class Send {
static final int DEFAULT_DLIMIT = 10; static final int DEFAULT_DLIMIT = 10;
static final int DEFAULT_TLIMIT = 24; // hours static final int DEFAULT_TLIMIT = 24; // hours
static final String DEFAULT_SERVER = "https://send.zcyph.cc/"; static final String DEFAULT_SERVER = "https://send.vis.ee/";
private static final int TIMEOUT = 20 * 1000; // milliseconds private static final int TIMEOUT = 20 * 1000; // milliseconds
@ -116,8 +116,12 @@ public class Send {
JSONObject jreply = new JSONObject(queue.remove(0)); JSONObject jreply = new JSONObject(queue.remove(0));
Log.i("Send reply=" + jreply); Log.i("Send reply=" + jreply);
if (jreply.has("error")) if (jreply.has("error")) {
throw new IOException("Error: " + jreply.getString("error")); String error = jreply.getString("error");
if ("400".equals(error))
error += " - try lower limits";
throw new IOException("Error: " + error);
}
result = jreply.getString("url") + result = jreply.getString("url") +
"#" + Base64.encodeToString(secret, Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP); "#" + Base64.encodeToString(secret, Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP);

@ -274,7 +274,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"lt_enabled", "lt_auto", "lt_picky", "lt_uri", "lt_user", "lt_key", "lt_enabled", "lt_auto", "lt_picky", "lt_uri", "lt_user", "lt_key",
"deepl_enabled", "deepl_enabled",
"vt_enabled", "vt_apikey", "vt_enabled", "vt_apikey",
"send_enabled", "send_host", "send_enabled", "send_host", "send_dlimit", "send_tlimit",
"openai_enabled", "openai_apikey", "openai_model", "openai_temperature", "openai_moderation", "openai_enabled", "openai_apikey", "openai_model", "openai_temperature", "openai_moderation",
"updates", "weekly", "beta", "show_changelog", "announcements", "updates", "weekly", "beta", "show_changelog", "announcements",
"crash_reports", "cleanup_attachments", "crash_reports", "cleanup_attachments",
@ -2256,8 +2256,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
(key.startsWith("announcement.") && cbGeneral.isChecked()) || (key.startsWith("announcement.") && cbGeneral.isChecked()) ||
(key.endsWith(".show_full") && cbFull.isChecked()) || (key.endsWith(".show_full") && cbFull.isChecked()) ||
(key.endsWith(".show_images") && cbImages.isChecked()) || (key.endsWith(".show_images") && cbImages.isChecked()) ||
(key.endsWith(".confirm_link") && cbLinks.isChecked())|| (key.endsWith(".confirm_link") && cbLinks.isChecked()) ||
(key.endsWith(".link_view") && cbLinks.isChecked())|| (key.endsWith(".link_view") && cbLinks.isChecked()) ||
(key.endsWith(".link_sanitize") && cbLinks.isChecked())) { (key.endsWith(".link_sanitize") && cbLinks.isChecked())) {
Log.i("Removing option=" + key); Log.i("Removing option=" + key);
editor.remove(key); editor.remove(key);

Loading…
Cancel
Save