[dovecot-cvs] dovecot/src/lib-storage mail-storage-private.h, 1.6, 1.7 mail-storage.c, 1.27, 1.28 mail-storage.h, 1.73, 1.74 proxy-mail-storage.c, 1.5, 1.6

cras at dovecot.org cras at dovecot.org
Fri Jul 23 00:20:03 EEST 2004


Update of /home/cvs/dovecot/src/lib-storage
In directory talvi:/tmp/cvs-serv11339/lib-storage

Modified Files:
	mail-storage-private.h mail-storage.c mail-storage.h 
	proxy-mail-storage.c 
Log Message:
Moved namespace and hierarchy separator handling to imap-specific code. LIST
now shows non-hidden namespaces in the LIST reply.



Index: mail-storage-private.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/mail-storage-private.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- mail-storage-private.h	18 Jul 2004 02:25:07 -0000	1.6
+++ mail-storage-private.h	22 Jul 2004 21:20:00 -0000	1.7
@@ -5,12 +5,9 @@
 
 struct mail_storage {
 	char *name;
-	char *namespace;
 	char hierarchy_sep;
 
-	struct mail_storage *(*create)(const char *data, const char *user,
-				       const char *namespace,
-				       char hierarchy_sep);
+	struct mail_storage *(*create)(const char *data, const char *user);
 	void (*destroy)(struct mail_storage *storage);
 
 	int (*autodetect)(const char *data);
@@ -31,7 +28,7 @@
 
 	struct mailbox_list_context *
 		(*mailbox_list_init)(struct mail_storage *storage,
-				     const char *mask,
+				     const char *ref, const char *mask,
 				     enum mailbox_list_flags flags);
 	struct mailbox_list *
 		(*mailbox_list_next)(struct mailbox_list_context *ctx);

Index: mail-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/mail-storage.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- mail-storage.c	18 Jul 2004 02:25:07 -0000	1.27
+++ mail-storage.c	22 Jul 2004 21:20:00 -0000	1.28
@@ -69,33 +69,28 @@
 }
 
 struct mail_storage *
-mail_storage_create(const char *name, const char *data, const char *user,
-		    const char *namespace, char hierarchy_sep)
+mail_storage_create(const char *name, const char *data, const char *user)
 {
 	struct mail_storage_list *list;
 
 	i_assert(name != NULL);
 
 	for (list = storages; list != NULL; list = list->next) {
-		if (strcasecmp(list->storage->name, name) == 0) {
-			return list->storage->create(data, user,
-						     namespace, hierarchy_sep);
-		}
+		if (strcasecmp(list->storage->name, name) == 0)
+			return list->storage->create(data, user);
 	}
 
 	return NULL;
 }
 
 struct mail_storage *
-mail_storage_create_default(const char *user,
-			    const char *namespace, char hierarchy_sep)
+mail_storage_create_default(const char *user)
 {
 	struct mail_storage_list *list;
 	struct mail_storage *storage;
 
 	for (list = storages; list != NULL; list = list->next) {
-		storage = list->storage->create(NULL, user, namespace,
-						hierarchy_sep);
+		storage = list->storage->create(NULL, user);
 		if (storage != NULL)
 			return storage;
 	}
@@ -116,16 +111,13 @@
 }
 
 struct mail_storage *
-mail_storage_create_with_data(const char *data, const char *user,
-			      const char *namespace, char hierarchy_sep)
+mail_storage_create_with_data(const char *data, const char *user)
 {
 	struct mail_storage *storage;
 	const char *p, *name;
 
-	if (data == NULL || *data == '\0') {
-		return mail_storage_create_default(user, namespace,
-						   hierarchy_sep);
-	}
+	if (data == NULL || *data == '\0')
+		return mail_storage_create_default(user);
 
 	/* check if we're in the form of mailformat:data
 	   (eg. maildir:Maildir) */
@@ -134,14 +126,11 @@
 
 	if (*p == ':') {
 		name = t_strdup_until(data, p);
-		storage = mail_storage_create(name, p+1, user,
-					      namespace, hierarchy_sep);
+		storage = mail_storage_create(name, p+1, user);
 	} else {
 		storage = mail_storage_autodetect(data);
-		if (storage != NULL) {
-			storage = storage->create(data, user,
-						  namespace, hierarchy_sep);
-		}
+		if (storage != NULL)
+			storage = storage->create(data, user);
 	}
 
 	return storage;
@@ -260,10 +249,10 @@
 
 struct mailbox_list_context *
 mail_storage_mailbox_list_init(struct mail_storage *storage,
-			       const char *mask,
+			       const char *ref, const char *mask,
 			       enum mailbox_list_flags flags)
 {
-	return storage->mailbox_list_init(storage, mask, flags);
+	return storage->mailbox_list_init(storage, ref, mask, flags);
 }
 
 struct mailbox_list *

Index: mail-storage.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/mail-storage.h,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- mail-storage.h	18 Jul 2004 02:25:07 -0000	1.73
+++ mail-storage.h	22 Jul 2004 21:20:00 -0000	1.74
@@ -167,16 +167,12 @@
    If namespace is non-NULL, all mailbox names are expected to begin with it.
    hierarchy_sep overrides the default separator if it's not '\0'. */
 struct mail_storage *
-mail_storage_create(const char *name, const char *data, const char *user,
-		    const char *namespace, char hierarchy_sep);
+mail_storage_create(const char *name, const char *data, const char *user);
 void mail_storage_destroy(struct mail_storage *storage);
 
+struct mail_storage *mail_storage_create_default(const char *user);
 struct mail_storage *
-mail_storage_create_default(const char *user,
-			    const char *namespace, char hierarchy_sep);
-struct mail_storage *
-mail_storage_create_with_data(const char *data, const char *user,
-			      const char *namespace, char hierarchy_sep);
+mail_storage_create_with_data(const char *data, const char *user);
 
 char mail_storage_get_hierarchy_sep(struct mail_storage *storage);
 
@@ -205,11 +201,11 @@
 				const char *oldname, const char *newname);
 
 /* Initialize new mailbox list request. mask may contain '%' and '*'
-   wildcards as defined in RFC2060. Matching against "INBOX" is
+   wildcards as defined in RFC3501. Matching against "INBOX" is
    case-insensitive, but anything else is not. */
 struct mailbox_list_context *
 mail_storage_mailbox_list_init(struct mail_storage *storage,
-			       const char *mask,
+			       const char *ref, const char *mask,
 			       enum mailbox_list_flags flags);
 /* Get next mailbox. Returns the mailbox name */
 struct mailbox_list *
@@ -259,8 +255,7 @@
 int mailbox_allow_new_keywords(struct mailbox *box);
 
 /* Gets the mailbox status information. */
-int mailbox_get_status(struct mailbox *box,
-		       enum mailbox_status_items items,
+int mailbox_get_status(struct mailbox *box, enum mailbox_status_items items,
 		       struct mailbox_status *status);
 
 /* Synchronize the mailbox. */

Index: proxy-mail-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/proxy-mail-storage.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- proxy-mail-storage.c	17 May 2004 13:02:33 -0000	1.5
+++ proxy-mail-storage.c	22 Jul 2004 21:20:01 -0000	1.6
@@ -52,12 +52,13 @@
 }
 
 static struct mailbox_list_context *
-_mailbox_list_init(struct mail_storage *storage, const char *mask,
+_mailbox_list_init(struct mail_storage *storage,
+		   const char *ref, const char *mask,
 		   enum mailbox_list_flags flags)
 {
 	struct proxy_mail_storage *s = (struct proxy_mail_storage *) storage;
 
-	return s->storage->mailbox_list_init(s->storage, mask, flags);
+	return s->storage->mailbox_list_init(s->storage, ref, mask, flags);
 }
 
 static int _set_subscribed(struct mail_storage *storage,



More information about the dovecot-cvs mailing list