Skip to content

Commit

Permalink
lib-storage: Stop namespaces_added|created hooks immediately when use…
Browse files Browse the repository at this point in the history
…r has failed
  • Loading branch information
sirainen authored and GitLab committed Jan 15, 2017
1 parent 92b98c7 commit da5c7f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib-storage/mail-storage-hooks.c
Expand Up @@ -292,6 +292,8 @@ void hook_mail_namespaces_created(struct mail_namespace *namespaces)
const struct mail_storage_hooks *const *hooks;

array_foreach(&namespaces->user->hooks, hooks) {
if (namespaces->user->error != NULL)
break;
if ((*hooks)->mail_namespaces_created != NULL) T_BEGIN {
(*hooks)->mail_namespaces_created(namespaces);
} T_END;
Expand All @@ -303,6 +305,8 @@ void hook_mail_namespaces_added(struct mail_namespace *namespaces)
const struct mail_storage_hooks *const *hooks;

array_foreach(&namespaces->user->hooks, hooks) {
if (namespaces->user->error != NULL)
break;
if ((*hooks)->mail_namespaces_added != NULL) T_BEGIN {
(*hooks)->mail_namespaces_added(namespaces);
} T_END;
Expand Down

0 comments on commit da5c7f6

Please sign in to comment.