]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Added "creator" for mail_user.
authorTimo Sirainen <tss@iki.fi>
Thu, 13 Nov 2014 07:53:35 +0000 (09:53 +0200)
committerTimo Sirainen <tss@iki.fi>
Thu, 13 Nov 2014 07:53:35 +0000 (09:53 +0200)
This allows fixing stats plugin to update stats also for shared mailboxes.
That's a bit complicated change though, so I'm not sure how soon it'll
happen. But at least this change makes it possible more easily later on.
Might have other uses too.

src/lib-storage/index/shared/shared-storage.c
src/lib-storage/mail-user.h

index e7260c4a791aaf6e34b001521d11aa9fa5ad4756..7310ab19130b63b6353fdb56935a26ad6a5e1f8f 100644 (file)
@@ -255,6 +255,7 @@ int shared_storage_get_namespace(struct mail_namespace **_ns,
 
        owner = mail_user_alloc(userdomain, user->set_info,
                                user->unexpanded_set);
+       owner->creator = user;
        owner->autocreated = TRUE;
        owner->session_id = p_strdup(owner->pool, user->session_id);
        if (mail_user_init(owner, &error) < 0) {
index c7237130b064fe238d5d229736467f7f534773c8..6b3b2b4191e1f2dda4ec74b22b95b4ae75ee99aa 100644 (file)
@@ -16,6 +16,10 @@ struct mail_user {
        struct mail_user_vfuncs v, *vlast;
        int refcount;
 
+       /* User's creator if such exists. For example for autocreated shared
+          mailbox users their creator is the logged in user. */
+       struct mail_user *creator;
+
        const char *username;
        /* don't access the home directly. It may be set lazily. */
        const char *_home;