]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
push-notification: Replace i_<log>() with e_<log>()
authorMarco Bettini <marco.bettini@open-xchange.com>
Wed, 20 Jul 2022 13:58:13 +0000 (13:58 +0000)
committerMarco Bettini <marco.bettini@open-xchange.com>
Wed, 20 Jul 2022 15:26:21 +0000 (15:26 +0000)
14 files changed:
src/plugins/push-notification/push-notification-driver-dlog.c
src/plugins/push-notification/push-notification-drivers.c
src/plugins/push-notification/push-notification-event-flagsclear.c
src/plugins/push-notification/push-notification-event-flagsset.c
src/plugins/push-notification/push-notification-event-mailboxcreate.c
src/plugins/push-notification/push-notification-event-mailboxdelete.c
src/plugins/push-notification/push-notification-event-mailboxrename.c
src/plugins/push-notification/push-notification-event-mailboxsubscribe.c
src/plugins/push-notification/push-notification-event-mailboxunsubscribe.c
src/plugins/push-notification/push-notification-event-messageappend.c
src/plugins/push-notification/push-notification-event-messageexpunge.c
src/plugins/push-notification/push-notification-event-messagenew.c
src/plugins/push-notification/push-notification-event-messageread.c
src/plugins/push-notification/push-notification-event-messagetrash.c

index ff6c49917585075fc736fa1dc22878530c0c270c..256340c70f4c0e1f19f3fd09f1caad50e2bf9a05 100644 (file)
@@ -41,10 +41,10 @@ push_notification_driver_dlog_init(
        ctx->event = log_event;
        *context = ctx;
 
-       i_debug("Called init push_notification plugin hook.");
-
+       e_debug(log_event, "Called init push_notification plugin hook.");
        if (config->raw_config != NULL) {
-               i_debug("Config string for dlog push_notification driver: %s",
+               e_debug(log_event,
+                       "Config string for dlog push_notification driver: %s",
                        config->raw_config);
        }
 
@@ -61,10 +61,9 @@ push_notification_driver_dlog_begin_txn(
        tctx->event = log_event;
        dtxn->context = tctx;
 
-       const struct push_notification_event *event;
-
-       i_debug("Called begin_txn push_notification plugin hook.");
+       e_debug(log_event, "Called begin_txn push_notification plugin hook.");
 
+       const struct push_notification_event *event;
        array_foreach_elem(&push_notification_events, event)
                push_notification_event_init(dtxn, event->name, NULL, log_event);
        return TRUE;
@@ -72,15 +71,14 @@ push_notification_driver_dlog_begin_txn(
 
 static void
 push_notification_driver_dlog_process_mbox(
-       struct push_notification_driver_txn *dtxn ATTR_UNUSED,
+       struct push_notification_driver_txn *dtxn,
        struct push_notification_txn_mbox *mbox)
 {
-       struct push_notification_txn_event *event;
-
-       i_debug("Called process_mbox push_notification plugin hook.");
-
-       i_debug("Mailbox data: Mailbox [%s]", mbox->mailbox);
+       struct dlog_push_notification_txn_context *tctx = dtxn->context;
+       e_debug(tctx->event, "Called process_mbox push_notification plugin hook.");
+       e_debug(tctx->event, "Mailbox data: Mailbox [%s]", mbox->mailbox);
 
+       struct push_notification_txn_event *event;
        if (array_is_created(&mbox->eventdata)) {
                array_foreach_elem(&mbox->eventdata, event) {
                        if (event->event->event->mbox.debug_mbox != NULL)
@@ -94,13 +92,12 @@ push_notification_driver_dlog_process_msg(
        struct push_notification_driver_txn *dtxn ATTR_UNUSED,
        struct push_notification_txn_msg *msg)
 {
-       struct push_notification_txn_event *event;
-
-       i_debug("Called process_msg push_notification plugin hook.");
-
-       i_debug("Message data: Mailbox [%s], UID [%u], UIDVALIDITY [%u]",
+       struct dlog_push_notification_txn_context *tctx = dtxn->context;
+       e_debug(tctx->event, "Called process_msg push_notification plugin hook.");
+       e_debug(tctx->event, "Message data: Mailbox [%s], UID [%u], UIDVALIDITY [%u]",
                msg->mailbox, msg->uid, msg->uid_validity);
 
+       struct push_notification_txn_event *event;
        if (array_is_created(&msg->eventdata)) {
                array_foreach_elem(&msg->eventdata, event) {
                        if (event->event->event->msg.debug_msg != NULL)
@@ -114,8 +111,8 @@ push_notification_driver_dlog_end_txn(
        struct push_notification_driver_txn *dtxn,
        bool success ATTR_UNUSED)
 {
-       i_debug("Called end_txn push_notification plugin hook.");
        struct dlog_push_notification_txn_context *tctx = dtxn->context;
+       e_debug(tctx->event, "Called end_txn push_notification plugin hook.");
        event_unref(&tctx->event);
 }
 
@@ -123,8 +120,8 @@ static void
 push_notification_driver_dlog_deinit(
        struct push_notification_driver_user *duser)
 {
-       i_debug("Called deinit push_notification plugin hook.");
        struct dlog_push_notification_context *ctx = duser->context;
+       e_debug(ctx->event, "Called deinit push_notification plugin hook.");
        event_unref(&ctx->event);
 }
 
index 67295d19ca3ed1d931e5761262a82d2834843533..175ac74f09e30d505513f5c296f2f7279583088a 100644 (file)
@@ -89,7 +89,8 @@ int push_notification_driver_init(
 
        driver = push_notification_driver_find_class(driver_name);
        if (driver == NULL) {
-               i_error("Unknown push notification driver: %s", driver_name);
+               e_error(user->event,
+                       "Unknown push notification driver: %s", driver_name);
                return -1;
        }
 
@@ -102,7 +103,8 @@ int push_notification_driver_init(
                        ret = driver->v.init(config, user, pool,
                                             &context, &error_r);
                        if (ret < 0)
-                               i_error("%s: %s", driver_name, error_r);
+                               e_error(user->event, "%s: %s",
+                                       driver_name, error_r);
                        hash_table_destroy(&config->config);
                } T_END;
 
index 2ce0c3f1922ee2f032a03c6baba32aff307c4417..2109f3aeee8f14473b07ff6678a009020d620254 100644 (file)
@@ -26,22 +26,23 @@ static void
 push_notification_event_flagsclear_debug_msg(
        struct push_notification_txn_event *event)
 {
+       struct event *log_event = event->event->log_event;
        struct push_notification_event_flagsclear_data *data = event->data;
        const char *keyword;
 
        if ((data->flags_clear & MAIL_ANSWERED) != 0)
-               i_debug("%s: Answered flag cleared", EVENT_NAME);
+               e_debug(log_event, "%s: Answered flag cleared", EVENT_NAME);
        if ((data->flags_clear & MAIL_FLAGGED) != 0)
-               i_debug("%s: Flagged flag cleared", EVENT_NAME);
+               e_debug(log_event, "%s: Flagged flag cleared", EVENT_NAME);
        if ((data->flags_clear & MAIL_DELETED) != 0)
-               i_debug("%s: Deleted flag cleared", EVENT_NAME);
+               e_debug(log_event, "%s: Deleted flag cleared", EVENT_NAME);
        if ((data->flags_clear & MAIL_SEEN) != 0)
-               i_debug("%s: Seen flag cleared", EVENT_NAME);
+               e_debug(log_event, "%s: Seen flag cleared", EVENT_NAME);
        if ((data->flags_clear & MAIL_DRAFT) != 0)
-               i_debug("%s: Draft flag cleared", EVENT_NAME);
+               e_debug(log_event, "%s: Draft flag cleared", EVENT_NAME);
 
        array_foreach_elem(&data->keywords_clear, keyword)
-               i_debug("%s: Keyword clear [%s]", EVENT_NAME, keyword);
+               e_debug(log_event, "%s: Keyword clear [%s]", EVENT_NAME, keyword);
 }
 
 static struct push_notification_event_flagsclear_data *
index c596ced8320eb289993e5d25a546a83507097624..1292d9531addec456dcb293ee5cd017bab5e48c0 100644 (file)
@@ -27,22 +27,23 @@ static void
 push_notification_event_flagsset_debug_msg(
        struct push_notification_txn_event *event)
 {
+       struct event *log_event = event->event->log_event;
        struct push_notification_event_flagsset_data *data = event->data;
        const char *keyword;
 
        if ((data->flags_set & MAIL_ANSWERED) != 0)
-               i_debug("%s: Answered flag set", EVENT_NAME);
+               e_debug(log_event, "%s: Answered flag set", EVENT_NAME);
        if ((data->flags_set & MAIL_FLAGGED) != 0)
-               i_debug("%s: Flagged flag set", EVENT_NAME);
+               e_debug(log_event, "%s: Flagged flag set", EVENT_NAME);
        if ((data->flags_set & MAIL_DELETED) != 0)
-               i_debug("%s: Deleted flag set", EVENT_NAME);
+               e_debug(log_event, "%s: Deleted flag set", EVENT_NAME);
        if ((data->flags_set & MAIL_SEEN) != 0)
-               i_debug("%s: Seen flag set", EVENT_NAME);
+               e_debug(log_event, "%s: Seen flag set", EVENT_NAME);
        if ((data->flags_set & MAIL_DRAFT) != 0)
-               i_debug("%s: Draft flag set", EVENT_NAME);
+               e_debug(log_event, "%s: Draft flag set", EVENT_NAME);
 
        array_foreach_elem(&data->keywords_set, keyword)
-               i_debug("%s: Keyword set [%s]", EVENT_NAME, keyword);
+               e_debug(log_event, "%s: Keyword set [%s]", EVENT_NAME, keyword);
 }
 
 static struct push_notification_event_flagsset_data *
index 87e46c1fcea98fc5969419666ae8a3535fa98606..f518239a475fa7feb118b6434ae233ad640f67a4 100644 (file)
 
 static void
 push_notification_event_mailboxcreate_debug_mbox(
-       struct push_notification_txn_event *event ATTR_UNUSED)
+       struct push_notification_txn_event *event)
 {
-       i_debug("%s: Mailbox was created", EVENT_NAME);
+       struct event *log_event = event->event->log_event;
+       e_debug(log_event, "%s: Mailbox was created", EVENT_NAME);
 }
 
 static void
@@ -27,7 +28,8 @@ push_notification_event_mailboxcreate_event(
        struct mailbox_status status;
 
        if (mailbox_get_status(ptxn->mbox, STATUS_UIDVALIDITY, &status) < 0) {
-               i_error(EVENT_NAME
+               e_error(ptxn->muser->event,
+                       EVENT_NAME
                        "Failed to get created mailbox '%s' uidvalidity: %s",
                        mailbox_get_vname(ptxn->mbox),
                        mailbox_get_last_internal_error(ptxn->mbox, NULL));
index 8e65f3cfb78c48eb319a8685d98c932dcdcb2fe7..16e14ef6fbd5d7ff964f3ab5d744912d8abd2c76 100644 (file)
 
 static void
 push_notification_event_mailboxdelete_debug_mbox(
-       struct push_notification_txn_event *event ATTR_UNUSED)
+       struct push_notification_txn_event *event)
 {
-       i_debug("%s: Mailbox was deleted", EVENT_NAME);
+       struct event *log_event = event->event->log_event;
+       e_debug(log_event, "%s: Mailbox was deleted", EVENT_NAME);
 }
 
 static void
index e4c2cae06010ef54a76f5a6a69e239436cea2bb4..c525827a7f957392c304e9b3e032255f8e8c6c9e 100644 (file)
@@ -15,8 +15,9 @@ push_notification_event_mailboxrename_debug_mbox(
        struct push_notification_txn_event *event)
 {
        struct push_notification_event_mailboxrename_data *data = event->data;
+       struct event *log_event = event->event->log_event;
 
-       i_debug("%s: Mailbox was renamed (old name: %s)",
+       e_debug(log_event, "%s: Mailbox was renamed (old name: %s)",
                EVENT_NAME, data->old_mbox);
 }
 
index 0bcd10140258a0095cd763255f0ca801d5194bd6..8f5927f7a01d531a6b85820729ccaf9c639ea201 100644 (file)
 
 static void
 push_notification_event_mailboxsubscribe_debug_mbox(
-       struct push_notification_txn_event *event ATTR_UNUSED)
+       struct push_notification_txn_event *event)
 {
-       i_debug("%s: Mailbox was subscribed to", EVENT_NAME);
+       struct event *log_event = event->event->log_event;
+       e_debug(log_event, "%s: Mailbox was subscribed to", EVENT_NAME);
 }
 
 static void
index b8d078f35e61ab370bd1083c2eb5fe5814f51209..1516d55509289308b9b476394333ae04e963461e 100644 (file)
 
 static void
 push_notification_event_mailboxunsubscribe_debug_mbox(
-       struct push_notification_txn_event *event ATTR_UNUSED)
+       struct push_notification_txn_event *event)
 {
-       i_debug("%s: Mailbox was subscribed to", EVENT_NAME);
+       struct event *log_event = event->event->log_event;
+       e_debug(log_event, "%s: Mailbox was subscribed to", EVENT_NAME);
 }
 
 static void
index b6e03187dbd327f43e464c7ca45c536a54a659f6..2fa8083a016c7a48f18fb6da1a91a12b19060e79 100644 (file)
@@ -30,23 +30,24 @@ static void
 push_notification_event_messageappend_debug_msg(
        struct push_notification_txn_event *event)
 {
+       struct event *log_event = event->event->log_event;
        struct push_notification_event_messageappend_data *data = event->data;
        struct tm *tm;
 
        if (data->date != -1) {
                tm = gmtime(&data->date);
-               i_debug("%s: Date [%s]", EVENT_NAME,
+               e_debug(log_event, "%s: Date [%s]", EVENT_NAME,
                        iso8601_date_create_tm(tm, data->date_tz));
        }
 
        if (data->from != NULL)
-               i_debug("%s: From [%s]", EVENT_NAME, data->from);
+               e_debug(log_event, "%s: From [%s]", EVENT_NAME, data->from);
        if (data->snippet != NULL)
-               i_debug("%s: Snippet [%s]", EVENT_NAME, data->snippet);
+               e_debug(log_event, "%s: Snippet [%s]", EVENT_NAME, data->snippet);
        if (data->subject != NULL)
-               i_debug("%s: Subject [%s]", EVENT_NAME, data->subject);
+               e_debug(log_event, "%s: Subject [%s]", EVENT_NAME, data->subject);
        if (data->to != NULL)
-               i_debug("%s: To [%s]", EVENT_NAME, data->to);
+               e_debug(log_event, "%s: To [%s]", EVENT_NAME, data->to);
 }
 
 static void
index cfa301e124006021cb01ef40bb61c235f3264d97..7920c88e26fbcc5a5cad49747c17a7b6d79d5cbf 100644 (file)
@@ -15,10 +15,11 @@ static void
 push_notification_event_messageexpunge_debug_msg(
        struct push_notification_txn_event *event)
 {
+       struct event *log_event = event->event->log_event;
        struct push_notification_event_messageexpunge_data *data = event->data;
 
        if (data != NULL)
-               i_debug("%s: Message was expunged", EVENT_NAME);
+               e_debug(log_event, "%s: Message was expunged", EVENT_NAME);
 }
 
 static void
index 930c0eeaf6f5275b88e255768db9a824b4d1e31d..38fc414a3a31986149fb4a310dce7f9308c337a7 100644 (file)
@@ -30,23 +30,24 @@ static void
 push_notification_event_messagenew_debug_msg(
        struct push_notification_txn_event *event)
 {
+       struct event *log_event = event->event->log_event;
        struct push_notification_event_messagenew_data *data = event->data;
        struct tm *tm;
 
        if (data->date != -1) {
                tm = gmtime(&data->date);
-               i_debug("%s: Date [%s]", EVENT_NAME,
+               e_debug(log_event, "%s: Date [%s]", EVENT_NAME,
                        iso8601_date_create_tm(tm, data->date_tz));
        }
 
        if (data->from != NULL)
-               i_debug("%s: From [%s]", EVENT_NAME, data->from);
+               e_debug(log_event, "%s: From [%s]", EVENT_NAME, data->from);
        if (data->snippet != NULL)
-               i_debug("%s: Snippet [%s]", EVENT_NAME, data->snippet);
+               e_debug(log_event, "%s: Snippet [%s]", EVENT_NAME, data->snippet);
        if (data->subject != NULL)
-               i_debug("%s: Subject [%s]", EVENT_NAME, data->subject);
+               e_debug(log_event, "%s: Subject [%s]", EVENT_NAME, data->subject);
        if (data->to != NULL)
-               i_debug("%s: To [%s]", EVENT_NAME, data->to);
+               e_debug(log_event, "%s: To [%s]", EVENT_NAME, data->to);
 }
 
 static void
index 8f0d7099234ffea07fb7130a05eb86f1df5718d6..a4307e38a3221480a6fa7c8ccb5c5a200bf3a72a 100644 (file)
 
 static void
 push_notification_event_messageread_debug_msg(
-       struct push_notification_txn_event *event ATTR_UNUSED)
+       struct push_notification_txn_event *event)
 {
-       i_debug("%s: Message was flagged as seen", EVENT_NAME);
+       struct event *log_event = event->event->log_event;
+       e_debug(log_event, "%s: Message was flagged as seen", EVENT_NAME);
 }
 
 static void
index 2284b6f136ba365042b05a47821d276826a380c0..ff8b9aeaae3a368ee347370192a38984bf0374c1 100644 (file)
 
 static void
 push_notification_event_messagetrash_debug_msg(
-       struct push_notification_txn_event *event ATTR_UNUSED)
+       struct push_notification_txn_event *event)
 {
-       i_debug("%s: Message was marked as deleted", EVENT_NAME);
+       struct event *log_event = event->event->log_event;
+       e_debug(log_event, "%s: Message was marked as deleted", EVENT_NAME);
 }
 
 static void