Skip to content
Snippets Groups Projects
Commit 414251d6 authored by Stephan Bosch's avatar Stephan Bosch
Browse files

lib-sieve: Fixed duplication of discard actions in result.

No duplicate check function was implemented, so that the discard action would be duplicated each time it is invoked.
This only affects the action limits (each discard invocation is counted as another new action).
The result of the script execution would be identical.
parent eed8e51d
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,13 @@ const struct sieve_operation_def cmd_discard_operation = { ...@@ -55,6 +55,13 @@ const struct sieve_operation_def cmd_discard_operation = {
* Discard actions * Discard actions
*/ */
static bool act_discard_equals
(const struct sieve_script_env *senv, const struct sieve_action *act1,
const struct sieve_action *act2);
static int act_discard_check_duplicate
(const struct sieve_runtime_env *renv,
const struct sieve_action *act,
const struct sieve_action *act_other);
static void act_discard_print static void act_discard_print
(const struct sieve_action *action, (const struct sieve_action *action,
const struct sieve_result_print_env *rpenv, bool *keep); const struct sieve_result_print_env *rpenv, bool *keep);
...@@ -64,6 +71,8 @@ static int act_discard_commit ...@@ -64,6 +71,8 @@ static int act_discard_commit
const struct sieve_action_def act_discard = { const struct sieve_action_def act_discard = {
.name = "discard", .name = "discard",
.equals = act_discard_equals,
.check_duplicate = act_discard_check_duplicate,
.print = act_discard_print, .print = act_discard_print,
.commit = act_discard_commit, .commit = act_discard_commit,
}; };
...@@ -115,6 +124,22 @@ static int cmd_discard_operation_execute ...@@ -115,6 +124,22 @@ static int cmd_discard_operation_execute
* Action implementation * Action implementation
*/ */
static bool act_discard_equals
(const struct sieve_script_env *senv ATTR_UNUSED,
const struct sieve_action *act1 ATTR_UNUSED,
const struct sieve_action *act2 ATTR_UNUSED)
{
return TRUE;
}
static int act_discard_check_duplicate
(const struct sieve_runtime_env *renv ATTR_UNUSED,
const struct sieve_action *act ATTR_UNUSED,
const struct sieve_action *act_other ATTR_UNUSED)
{
return 1;
}
static void act_discard_print static void act_discard_print
(const struct sieve_action *action ATTR_UNUSED, (const struct sieve_action *action ATTR_UNUSED,
const struct sieve_result_print_env *rpenv, bool *keep) const struct sieve_result_print_env *rpenv, bool *keep)
......
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.