+ /*
+ * djcb: if we're in low-memory state, we only allow for
+ * saving 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))) {
+ 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);
+ modest_msg_edit_window_free_msg_data (edit_window, data);
+ return FALSE;
+ }
+