}
static void
-maildir_quota_storage_added(struct quota *quota,
- struct mail_storage *_storage)
+maildir_quota_storage_added(struct quota *quota, struct mail_storage *storage)
{
- struct maildir_storage *storage =
- (struct maildir_storage *)_storage;
struct quota_root **roots;
unsigned int i, count;
- if (strcmp(_storage->name, "maildir") != 0)
+ if (strcmp(storage->name, "maildir") != 0)
return;
roots = array_get_modifiable("a->roots, &count);
for (i = 0; i < count; i++) {
if (roots[i]->backend.name == quota_backend_maildir.name)
- maildir_quota_root_storage_added(roots[i], _storage);
+ maildir_quota_root_storage_added(roots[i], storage);
}
-
- /* For newly generated filenames add ,S=size. */
- storage->save_size_in_filename = TRUE;
}
static const char *const *
#include "array.h"
#include "hash.h"
#include "mailbox-list-private.h"
+#include "maildir-storage.h"
#include "quota-private.h"
#include "quota-fs.h"
return found;
}
+static void quota_maildir_storage_set(struct mail_storage *storage)
+{
+ /* FIXME: a bit ugly location for this code. */
+ if (strcmp(storage->name, "maildir") == 0) {
+ /* For newly generated filenames add ,S=size. */
+ struct maildir_storage *mstorage =
+ (struct maildir_storage *)storage;
+
+ mstorage->save_size_in_filename = TRUE;
+ }
+}
+
void quota_add_user_storage(struct quota *quota, struct mail_storage *storage)
{
struct quota_root *const *roots;
unsigned int i, j, count;
bool is_file;
+ quota_maildir_storage_set(storage);
+
/* first check if there already exists a storage with the exact same
path. we don't want to count them twice. */
path = mail_storage_get_mailbox_path(storage, "", &is_file);