dovecot-2.2: lib-storage: Added "creator" for mail_user.

dovecot at dovecot.org dovecot at dovecot.org
Thu Nov 13 07:55:08 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/ba74ec089370
changeset: 18078:ba74ec089370
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Nov 13 09:53:35 2014 +0200
description:
lib-storage: Added "creator" for mail_user.
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.

diffstat:

 src/lib-storage/index/shared/shared-storage.c |  1 +
 src/lib-storage/mail-user.h                   |  4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)

diffs (25 lines):

diff -r e3b52d11d038 -r ba74ec089370 src/lib-storage/index/shared/shared-storage.c
--- a/src/lib-storage/index/shared/shared-storage.c	Thu Nov 13 09:39:24 2014 +0200
+++ b/src/lib-storage/index/shared/shared-storage.c	Thu Nov 13 09:53:35 2014 +0200
@@ -255,6 +255,7 @@
 
 	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) {
diff -r e3b52d11d038 -r ba74ec089370 src/lib-storage/mail-user.h
--- a/src/lib-storage/mail-user.h	Thu Nov 13 09:39:24 2014 +0200
+++ b/src/lib-storage/mail-user.h	Thu Nov 13 09:53:35 2014 +0200
@@ -16,6 +16,10 @@
 	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;


More information about the dovecot-cvs mailing list