changeset 22503:2a6a6cfe8af6

notify-status: Provide access to all easy fields
author Aki Tuomi <aki.tuomi@dovecot.fi>
date Mon, 04 Sep 2017 15:32:24 +0300
parents fc335480acb3
children 5db98cc03836
files src/plugins/notify-status/notify-status-plugin.c
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/notify-status/notify-status-plugin.c	Tue Jul 04 14:22:19 2017 +0300
+++ b/src/plugins/notify-status/notify-status-plugin.c	Mon Sep 04 15:32:24 2017 +0300
@@ -112,6 +112,11 @@
 	i_error("notify-status: dict_transaction_commit failed");
 }
 
+#define MAILBOX_STATUS_NOTIFY (STATUS_MESSAGES|STATUS_UNSEEN|\
+			       STATUS_RECENT|STATUS_UIDNEXT|\
+			       STATUS_UIDVALIDITY|STATUS_FIRST_UNSEEN_SEQ|\
+			       STATUS_HIGHESTMODSEQ|STATUS_FIRST_RECENT_UID|\
+			       STATUS_HIGHESTPVTMODSEQ)
 static void notify_update_mailbox_status(struct mailbox *box)
 {
 	struct mail_user *user = mail_storage_get_user(mailbox_get_storage(box));
@@ -135,7 +140,7 @@
 		i_error("notify-status: mailbox_sync(%s) failed: %s",
 			  mailbox_get_vname(box),
 			  mailbox_get_last_error(box, NULL));
-	} else if (mailbox_get_status(box, STATUS_MESSAGES|STATUS_UNSEEN,
+	} else if (mailbox_get_status(box, MAILBOX_STATUS_NOTIFY,
 				      &status) < 0) {
 		i_error("notify-status: mailbox_get_status(%s) failed: %s",
 			  mailbox_get_vname(box),
@@ -152,6 +157,13 @@
 			{ '\0', str_c(mboxname), "mailbox" },
 			{ '\0', dec2str(status.messages), "messages" },
 			{ '\0', dec2str(status.unseen), "unseen" },
+			{ '\0', dec2str(status.recent), "recent" },
+			{ '\0', dec2str(status.uidvalidity), "uidvalidity" },
+			{ '\0', dec2str(status.uidnext), "uidnext" },
+			{ '\0', dec2str(status.first_unseen_seq), "first_unseen_seq" },
+			{ '\0', dec2str(status.first_recent_uid), "first_recent_uid" },
+			{ '\0', dec2str(status.highest_modseq), "highest_modseq" },
+			{ '\0', dec2str(status.highest_pvt_modseq), "highest_pvt_modseq" },
 			{ '\0', NULL, NULL }
 		};
 		const char *key =