changeset 9596:e5f3bd280210 HEAD

quota: Fixed ns=prefix to work for private namespaces.
author Timo Sirainen <tss@iki.fi>
date Tue, 03 Aug 2010 13:11:47 +0100
parents 166a188f9165
children 367ce71922bf
files src/plugins/quota/quota-storage.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/quota/quota-storage.c	Fri Jul 30 16:55:58 2010 +0100
+++ b/src/plugins/quota/quota-storage.c	Tue Aug 03 13:11:47 2010 +0100
@@ -557,16 +557,18 @@
 	struct quota_root *root;
 	bool add;
 
+	/* see if we have a quota explicitly defined for this namespace */
+	quota = quota_get_mail_user_quota(list->ns->user);
+	root = quota_find_root_for_ns(quota, list->ns);
+	if (root != NULL)
+		root->ns = list->ns;
+
 	if ((list->ns->flags & NAMESPACE_FLAG_NOQUOTA) != 0)
 		add = FALSE;
 	else if (list->ns->owner == NULL) {
-		/* see if we have a quota explicitly defined for
-		   this namespace */
-		quota = quota_get_mail_user_quota(list->ns->user);
-		root = quota_find_root_for_ns(quota, list->ns);
+		/* public namespace - add quota only if namespace is
+		   explicitly defined for it */
 		add = root != NULL;
-		if (root != NULL)
-			root->ns = list->ns;
 	} else {
 		add = TRUE;
 	}