- available_disk = modest_folder_available_space (NULL);
- modest_msg_edit_window_get_parts_size (edit_window, &parts_count, &parts_size);
- expected_size = modest_tny_msg_estimate_size (data->plain_body,
- data->html_body,
- parts_count,
- parts_size);
-
- if ((available_disk != -1) && expected_size > available_disk) {
- modest_msg_edit_window_free_msg_data (edit_window, data);
-
- modest_platform_information_banner (NULL, NULL, dgettext("ke-recv", "cerm_device_memory_full"));
- return FALSE;
- }
-
-
- /*
- * djcb: if we're in low-memory state, we only allow for sending messages
- * smaller than MODEST_MAX_LOW_MEMORY_MESSAGE_SIZE (see modest-defs.h)
- * this should still allow for sending anything critical...
- */
- if (expected_size > MODEST_MAX_LOW_MEMORY_MESSAGE_SIZE) {
- if (modest_platform_check_memory_low (MODEST_WINDOW(edit_window), TRUE)) {
- modest_msg_edit_window_free_msg_data (edit_window, data);
- return FALSE;
- }
- }
-
- /*
- * djcb: we also make sure that the attachments are smaller than the max size
- * this is for the case where we'd try to forward a message with attachments
- * bigger than our max allowed size, or sending an message from drafts which
- * somehow got past our checks when attaching.
- */
- if (expected_size > MODEST_MAX_ATTACHMENT_SIZE) {
- modest_platform_run_information_dialog (
- GTK_WINDOW(edit_window),
- dgettext("ke-recv","memr_ib_operation_disabled"),
- TRUE);