]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dict: Add "user" field to dict_* events if it's not empty
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sun, 26 Apr 2020 18:17:53 +0000 (21:17 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Sun, 26 Apr 2020 18:18:28 +0000 (21:18 +0300)
src/lib-dict/dict.c

index 53bd2c6059b477bdc04b9946f575f5912dbd7991..26a90cafdf41a167219b124f69a507326c0f15b3 100644 (file)
@@ -104,6 +104,8 @@ int dict_init(const char *uri, const struct dict_settings *set,
        struct event *event = event_create(set->event_parent);
        event_add_category(event, &event_category_dict);
        event_add_str(event, "driver", dict->name);
+       if (set->username[0] != '\0')
+               event_add_str(event, "user", set->username);
        event_set_append_log_prefix(event, t_strdup_printf("dict(%s)<%s>: ",
                                    dict->name, set->username));
        set_dup.event_parent = event;