dovecot-2.2: NOTIFY: Fixed "subscribed" mailbox filter to actual...

dovecot at dovecot.org dovecot at dovecot.org
Tue Sep 4 19:05:57 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/13e7c1e30c0e
changeset: 15029:13e7c1e30c0e
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Sep 04 19:05:18 2012 +0300
description:
NOTIFY: Fixed "subscribed" mailbox filter to actually work.

diffstat:

 src/imap/cmd-notify.c  |  3 +++
 src/imap/imap-notify.c |  8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r c00df434bfb9 -r 13e7c1e30c0e src/imap/cmd-notify.c
--- a/src/imap/cmd-notify.c	Tue Sep 04 19:04:52 2012 +0300
+++ b/src/imap/cmd-notify.c	Tue Sep 04 19:05:18 2012 +0300
@@ -435,7 +435,10 @@
 	if (!imap_notify_ns_want_status(notify_ns))
 		return;
 
+	/* set _RETURN_SUBSCRIBED flag just in case IMAP_NOTIFY_TYPE_SUBSCRIBED
+	   is used, which requires refreshing subscriptions */
 	iter = mailbox_list_iter_init(notify_ns->ns->list, "*",
+				      MAILBOX_LIST_ITER_RETURN_SUBSCRIBED |
 				      MAILBOX_LIST_ITER_RETURN_NO_FLAGS);
 	while ((info = mailbox_list_iter_next(iter)) != NULL) {
 		array_foreach(&notify_ns->mailboxes, notify_boxes) {
diff -r c00df434bfb9 -r 13e7c1e30c0e src/imap/imap-notify.c
--- a/src/imap/imap-notify.c	Tue Sep 04 19:04:52 2012 +0300
+++ b/src/imap/imap-notify.c	Tue Sep 04 19:05:18 2012 +0300
@@ -201,14 +201,18 @@
 			       const struct imap_notify_mailboxes *notify_boxes,
 			       const char *vname)
 {
+	struct mailbox *box;
 	const char *const *namep;
 	unsigned int name_len;
 	char ns_sep;
+	bool ret;
 
 	switch (notify_boxes->type) {
 	case IMAP_NOTIFY_TYPE_SUBSCRIBED:
-		// FIXME
-		return TRUE;
+		box = mailbox_alloc(notify_ns->ns->list, vname, 0);
+		ret = mailbox_is_subscribed(box);
+		mailbox_free(&box);
+		return ret;
 	case IMAP_NOTIFY_TYPE_SUBTREE:
 		ns_sep = mail_namespace_get_sep(notify_ns->ns);
 		array_foreach(&notify_boxes->names, namep) {


More information about the dovecot-cvs mailing list