[dovecot-cvs] dovecot/src/imap cmd-delete.c, 1.11, 1.12 cmd-rename.c, 1.9, 1.10

tss at dovecot.org tss at dovecot.org
Thu Mar 29 10:59:29 EEST 2007


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv11000/imap

Modified Files:
	cmd-delete.c cmd-rename.c 
Log Message:
Moved delete/rename operations to mailbox_list API. Fixed mbox/maildir to
work with either fs/maildir++ directory layout. They can be changed by
appending :LAYOUT=fs|maildir++ to mail_location.



Index: cmd-delete.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-delete.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- cmd-delete.c	14 Jan 2006 18:47:21 -0000	1.11
+++ cmd-delete.c	29 Mar 2007 07:59:26 -0000	1.12
@@ -7,6 +7,7 @@
 {
 	struct client *client = cmd->client;
 	struct mail_storage *storage;
+	struct mailbox_list *list;
 	struct mailbox *mailbox;
 	const char *name;
 
@@ -41,9 +42,12 @@
 		name = t_strndup(name, strlen(name)-1);
 	}
 
-	if (mail_storage_mailbox_delete(storage, name) < 0)
+	list = mail_storage_get_list(storage);
+	if (mailbox_list_delete_mailbox(list, name) < 0) {
+		mail_storage_set_list_error(storage);
 		client_send_storage_error(cmd, storage);
-	else
+	} else {
 		client_send_tagline(cmd, "OK Delete completed.");
+	}
 	return TRUE;
 }

Index: cmd-rename.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-rename.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cmd-rename.c	13 Jan 2006 20:25:59 -0000	1.9
+++ cmd-rename.c	29 Mar 2007 07:59:26 -0000	1.10
@@ -6,6 +6,7 @@
 bool cmd_rename(struct client_command_context *cmd)
 {
 	struct mail_storage *old_storage, *new_storage;
+	struct mailbox_list *list;
 	const char *oldname, *newname;
 
 	/* <old name> <new name> */
@@ -29,10 +30,12 @@
 		return TRUE;
 	}
 
-	if (mail_storage_mailbox_rename(old_storage, oldname, newname) < 0)
+	list = mail_storage_get_list(old_storage);
+	if (mailbox_list_rename_mailbox(list, oldname, newname) < 0) {
+		mail_storage_set_list_error(old_storage);
 		client_send_storage_error(cmd, old_storage);
-	else
+	} else {
 		client_send_tagline(cmd, "OK Rename completed.");
-
+	}
 	return TRUE;
 }



More information about the dovecot-cvs mailing list