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

lib-sieve: sieve-script - Split off sieve_script_update_event()

parent 84c8cf25
No related branches found
No related tags found
No related merge requests found
...@@ -87,6 +87,18 @@ bool sieve_script_name_is_valid(const char *scriptname) ...@@ -87,6 +87,18 @@ bool sieve_script_name_is_valid(const char *scriptname)
* Script instance * Script instance
*/ */
static void sieve_script_update_event(struct sieve_script *script)
{
if (script->name == NULL)
event_set_append_log_prefix(script->event, "script: ");
else {
event_add_str(script->event, "script_name", script->name);
event_set_append_log_prefix(
script->event, t_strdup_printf("script '%s': ",
script->name));
}
}
void sieve_script_init(struct sieve_script *script, void sieve_script_init(struct sieve_script *script,
struct sieve_storage *storage, struct sieve_storage *storage,
const struct sieve_script *script_class, const struct sieve_script *script_class,
...@@ -98,17 +110,11 @@ void sieve_script_init(struct sieve_script *script, ...@@ -98,17 +110,11 @@ void sieve_script_init(struct sieve_script *script,
script->refcount = 1; script->refcount = 1;
script->storage = storage; script->storage = storage;
script->location = p_strdup_empty(script->pool, location); script->location = p_strdup_empty(script->pool, location);
script->name = p_strdup(script->pool, name); script->name = p_strdup_empty(script->pool, name);
script->event = event_create(storage->event); script->event = event_create(storage->event);
event_add_str(script->event, "script_name", name);
event_add_str(script->event, "script_location", location); event_add_str(script->event, "script_location", location);
if (name == NULL) sieve_script_update_event(script);
event_set_append_log_prefix(script->event, "script: ");
else {
event_set_append_log_prefix(
script->event, t_strdup_printf("script '%s': ", name));
}
sieve_storage_ref(storage); sieve_storage_ref(storage);
} }
......
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.