X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-mail-operation.c;h=56f6783482e29fff8b3a01ad3ea7a7ae58e88a2f;hp=b13d9ef76bd94fcdf930114b54c21fd88f559a8e;hb=8f8039fef5dcff6cbc7b156053fd912c9fad2f43;hpb=5b745b2530945a03a3901d3d93d38fcda48fb163 diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index b13d9ef..56f6783 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -1264,6 +1264,13 @@ modest_mail_operation_create_folder (ModestMailOperation *self, } } + if (!strcmp (name, " ") || strchr (name, '/')) { + priv->status = MODEST_MAIL_OPERATION_STATUS_FAILED; + g_set_error (&(priv->error), MODEST_MAIL_OPERATION_ERROR, + MODEST_MAIL_OPERATION_ERROR_FOLDER_RULES, + _("mail_in_ui_folder_create_error")); + } + if (!priv->error) { /* Create the folder */ new_folder = tny_folder_store_create_folder (parent, name, &(priv->error)); @@ -1486,18 +1493,24 @@ modest_mail_operation_rename_folder (ModestMailOperation *self, /* Notify about operation end */ modest_mail_operation_notify_end (self, FALSE); + } else if (!strcmp (name, " ") || strchr (name, '/')) { + priv->status = MODEST_MAIL_OPERATION_STATUS_FAILED; + g_set_error (&(priv->error), MODEST_MAIL_OPERATION_ERROR, + MODEST_MAIL_OPERATION_ERROR_FOLDER_RULES, + _("FIXME: unable to rename")); + /* Notify about operation end */ + modest_mail_operation_notify_end (self, FALSE); } else { - /* Rename. Camel handles folder subscription/unsubscription */ TnyFolderStore *into; + /* Rename. Camel handles folder subscription/unsubscription */ into = tny_folder_get_folder_store (folder); tny_folder_copy_async (folder, into, name, TRUE, transfer_folder_cb, transfer_folder_status_cb, self); if (into) - g_object_unref (into); - + g_object_unref (into); } }