Skip to content

Commit

Permalink
lib-storage: Another fix to mail storage initialization.
Browse files Browse the repository at this point in the history
Allow mail_namespaces_init_location() to add the namespace directly to user,
since that's what the current callers always want. But compared to the
original code we're now calling mail_namespaces_init_finish() rather than
doing the same things ourself.
  • Loading branch information
sirainen committed May 2, 2016
1 parent 21c4d79 commit 9cd4b2d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib-storage/mail-namespace.c
Expand Up @@ -405,8 +405,7 @@ int mail_namespaces_init(struct mail_user *user, const char **error_r)

if (namespaces == NULL) {
/* no namespaces defined, create a default one */
if (mail_namespaces_init_location(user, NULL, error_r) < 0)
return -1;
return mail_namespaces_init_location(user, NULL, error_r);
}
return mail_namespaces_init_finish(namespaces, error_r);
}
Expand Down Expand Up @@ -492,7 +491,7 @@ int mail_namespaces_init_location(struct mail_user *user, const char *location,
mail_namespace_free(ns);
return -1;
}
return 0;
return mail_namespaces_init_finish(ns, error_r);
}

struct mail_namespace *mail_namespaces_init_empty(struct mail_user *user)
Expand Down

0 comments on commit 9cd4b2d

Please sign in to comment.