]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
notify-status: Provide access to all easy fields
authorAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 4 Sep 2017 12:32:24 +0000 (15:32 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 4 Sep 2017 13:06:50 +0000 (16:06 +0300)
src/plugins/notify-status/notify-status-plugin.c

index 8313efd19b994685b1a5df0cb348f40b67b67630..a6e6a27e5dcb65fe8e0900a54704789cb3bf5bed 100644 (file)
@@ -117,6 +117,11 @@ static void notify_update_callback(const struct dict_commit_result *result,
                result->error == NULL ? "" : result->error);
 }
 
+#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));
@@ -140,7 +145,7 @@ static void notify_update_mailbox_status(struct mailbox *box)
                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),
@@ -157,6 +162,13 @@ static void notify_update_mailbox_status(struct mailbox *box)
                        { '\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 *error;