]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-plugins: Use client_add_capability() for adding dynamic capabilities
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 24 Apr 2017 15:13:13 +0000 (18:13 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 24 Apr 2017 15:55:17 +0000 (18:55 +0300)
src/plugins/imap-acl/imap-acl-plugin.c
src/plugins/imap-quota/imap-quota-plugin.c
src/plugins/imap-zlib/imap-zlib-plugin.c

index eef069a768c17bb256e8009146b42d16a02677d2..52b06cb27378789b4ebf16f96e29a3fb0459fce1 100644 (file)
@@ -683,8 +683,10 @@ static bool cmd_deleteacl(struct client_command_context *cmd)
 
 static void imap_acl_client_created(struct client **client)
 {
-       if (mail_user_is_plugin_loaded((*client)->user, imap_acl_module))
-               str_append((*client)->capability_string, " ACL RIGHTS=texk");
+       if (mail_user_is_plugin_loaded((*client)->user, imap_acl_module)) {
+               client_add_capability(*client, "ACL");
+               client_add_capability(*client, "RIGHTS=texk");
+       }
 
        if (next_hook_client_created != NULL)
                next_hook_client_created(client);
index 931d3971cd4a23465626c633000b764578740dda..dab7c2877fc59c6e620de9df38115f1796b33eef 100644 (file)
@@ -222,7 +222,7 @@ static bool cmd_setquota(struct client_command_context *cmd)
 static void imap_quota_client_created(struct client **client)
 {
        if (mail_user_is_plugin_loaded((*client)->user, imap_quota_module))
-               str_append((*client)->capability_string, " QUOTA");
+               client_add_capability(*client, "QUOTA");
 
        if (next_hook_client_created != NULL)
                next_hook_client_created(client);
index e9f9f0d04c557671eebddf0e768f6dd81f6c4b24..40fdcee34645a4b31acef2666db124921ee05b60 100644 (file)
@@ -145,7 +145,7 @@ static void imap_zlib_client_created(struct client **clientp)
                zclient->next_state_export = (*clientp)->v.state_export;
                (*clientp)->v.state_export = imap_zlib_state_export;
 
-               str_append(client->capability_string, " COMPRESS=DEFLATE");
+               client_add_capability(*clientp, "COMPRESS=DEFLATE");
        }
 
        if (next_hook_client_created != NULL)