diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index eb2829d9f7..4931160350 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -1495,6 +1495,21 @@ enum mailbox_feature client_enabled_mailbox_features(struct client *client) return client->enabled_features; } +const char *const *client_enabled_features(struct client *client) +{ + static const char *condstore_str = "CONDSTORE"; + static const char *qresync_str = "QRESYNC"; + ARRAY_TYPE(const_string) features; + t_array_init(&features, 8); + + if ((client->enabled_features & imap_feature_condstore) != 0) + array_append(&features, &condstore_str, 1); + if ((client->enabled_features & imap_feature_qresync) != 0) + array_append(&features, &qresync_str, 1); + array_append_zero(&features); + return array_idx(&features, 0); +} + struct imap_search_update * client_search_update_lookup(struct client *client, const char *tag, unsigned int *idx_r) diff --git a/src/imap/imap-client.h b/src/imap/imap-client.h index d8ed67734f..d391587029 100644 --- a/src/imap/imap-client.h +++ b/src/imap/imap-client.h @@ -310,6 +310,8 @@ void client_enable(struct client *client, unsigned int feature_idx); bool client_has_enabled(struct client *client, unsigned int feature_idx); /* Returns mailbox features that are currently enabled. */ enum mailbox_feature client_enabled_mailbox_features(struct client *client); +/* Returns all enabled features as strings. */ +const char *const *client_enabled_features(struct client *client); /* Send client processing to imap-idle process. If successful, returns TRUE and destroys the client. */