]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Add IMAP_NOTIFY_EVENT_COUNT and verify its name array size
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sat, 3 Dec 2022 12:10:20 +0000 (14:10 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 12 Dec 2022 09:49:39 +0000 (11:49 +0200)
src/imap/cmd-notify.c
src/imap/imap-notify.h

index 25d613deae9c747945101f616e0a0fde32178a47..3e680bf4d068a31b9a93175c99a9ac13a2b2d5de 100644 (file)
@@ -17,6 +17,7 @@ static const char *imap_notify_event_names[] = {
        "MailboxName", "SubscriptionChange", "MailboxMetadataChange",
        "ServerMetadataChange"
 };
+static_assert_array_size(imap_notify_event_names, IMAP_NOTIFY_EVENT_COUNT);
 
 static int
 cmd_notify_parse_event(const struct imap_arg *arg,
index 936d62204729ece0bdc1862cf0651c5f32f66f8f..c5fa4ae1ac3848cac268a6ae0d55dfc31660de6e 100644 (file)
@@ -15,7 +15,9 @@ enum imap_notify_event {
        IMAP_NOTIFY_EVENT_MAILBOX_NAME          = 0x10,
        IMAP_NOTIFY_EVENT_SUBSCRIPTION_CHANGE   = 0x20,
        IMAP_NOTIFY_EVENT_MAILBOX_METADATA_CHANGE = 0x40,
-       IMAP_NOTIFY_EVENT_SERVER_METADATA_CHANGE = 0x80
+       IMAP_NOTIFY_EVENT_SERVER_METADATA_CHANGE = 0x80,
+
+       IMAP_NOTIFY_EVENT_COUNT = 8
 };
 #define UNSUPPORTED_EVENTS \
        (IMAP_NOTIFY_EVENT_ANNOTATION_CHANGE | \