Skip to content
Snippets Groups Projects
Commit 00b254e1 authored by Stephan Bosch's avatar Stephan Bosch Committed by Timo Sirainen
Browse files

managesieve: managesieve-capabilities - Avoid retrieving capabilities more than once

Also make code cleaner and consistent.
parent b048cd44
No related branches found
No related tags found
No related merge requests found
...@@ -64,7 +64,7 @@ void managesieve_capabilities_dump(void) ...@@ -64,7 +64,7 @@ void managesieve_capabilities_dump(void)
const struct plugin_settings *global_plugin_settings; const struct plugin_settings *global_plugin_settings;
struct sieve_environment svenv; struct sieve_environment svenv;
struct sieve_instance *svinst; struct sieve_instance *svinst;
const char *notify_cap; const char *sieve_cap, *notify_cap;
/* Read plugin settings */ /* Read plugin settings */
...@@ -83,15 +83,13 @@ void managesieve_capabilities_dump(void) ...@@ -83,15 +83,13 @@ void managesieve_capabilities_dump(void)
/* Dump capabilities */ /* Dump capabilities */
sieve_cap = sieve_get_capabilities(svinst, NULL);
notify_cap = sieve_get_capabilities(svinst, "notify"); notify_cap = sieve_get_capabilities(svinst, "notify");
if (notify_cap == NULL) if (notify_cap == NULL)
printf("SIEVE: %s\n", sieve_get_capabilities(svinst, NULL)); printf("SIEVE: %s\n", sieve_cap);
else { else
printf("SIEVE: %s, NOTIFY: %s\n", printf("SIEVE: %s, NOTIFY: %s\n", sieve_cap, notify_cap);
sieve_get_capabilities(svinst, NULL),
sieve_get_capabilities(svinst, "notify"));
}
settings_free(global_plugin_settings); settings_free(global_plugin_settings);
sieve_deinit(&svinst); sieve_deinit(&svinst);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.