Is there enough cake?

pull/184/head
M66B 5 years ago
parent d74a7c17d4
commit e7dd1e1c50

@ -1209,7 +1209,7 @@ class Core {
}
}
private static void onDelete(Context context, JSONArray jargs, EntityAccount account, EntityFolder folder, EntityMessage message, POP3Folder ifolder, POP3Store istore, State state) throws MessagingException {
private static void onDelete(Context context, JSONArray jargs, EntityAccount account, EntityFolder folder, EntityMessage message, POP3Folder ifolder, POP3Store istore, State state) throws MessagingException, IOException {
// Delete message
DB db = DB.getInstance(context);
@ -1295,7 +1295,7 @@ class Core {
}
}
private static void onHeaders(Context context, JSONArray jargs, EntityFolder folder, EntityMessage message, IMAPFolder ifolder) throws MessagingException {
private static void onHeaders(Context context, JSONArray jargs, EntityFolder folder, EntityMessage message, IMAPFolder ifolder) throws MessagingException, IOException {
// Download headers
DB db = DB.getInstance(context);
@ -1747,7 +1747,7 @@ class Core {
private static void onSynchronizeMessages(
Context context, JSONArray jargs,
EntityAccount account, final EntityFolder folder,
POP3Folder ifolder, POP3Store istore, State state) throws MessagingException {
POP3Folder ifolder, POP3Store istore, State state) throws MessagingException, IOException {
DB db = DB.getInstance(context);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean notify_known = prefs.getBoolean("notify_known", false);

@ -115,6 +115,7 @@ public class MessageHelper {
private static final long ATTACHMENT_PROGRESS_UPDATE = 1500L; // milliseconds
private static final int MAX_META_EXCERPT = 1024; // characters
private static final int FORMAT_FLOWED_LINE_LENGTH = 72;
private static final long MIN_REQUIRED_SPACE = 250 * 1024L ^ 3;
// https://tools.ietf.org/html/rfc4021
@ -755,7 +756,10 @@ public class MessageHelper {
}
}
MessageHelper(MimeMessage message, Context context) {
MessageHelper(MimeMessage message, Context context) throws IOException {
long cake = Helper.getAvailableStorageSpace();
if (cake < MIN_REQUIRED_SPACE)
throw new IOException(context.getString(R.string.app_cake));
if (cacheDir == null)
cacheDir = context.getCacheDir();
this.imessage = message;

@ -8,6 +8,7 @@
<string name="app_eula" translatable="false">THIS SOFTWARE IS PROVIDED BY THE AUTHOR \'\'AS IS\'\' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</string>
<string name="app_crash">FairEmail is not supported on this device because bugs in Android cause crashes</string>
<string name="app_exit">Go \'back\' again to exit</string>
<string name="app_cake">Insufficient storage space left</string>
<string name="channel_service">Receive</string>
<string name="channel_send">Send</string>

Loading…
Cancel
Save