From: Marco Bettini Date: Wed, 20 Jul 2022 13:58:13 +0000 (+0000) Subject: push-notification: Replace i_() with e_() X-Git-Tag: 2.4.0~3745 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a16eb19d71ec4d312832bf38c6f6fddbc207d1b2;p=thirdparty%2Fdovecot%2Fcore.git push-notification: Replace i_() with e_() --- diff --git a/src/plugins/push-notification/push-notification-driver-dlog.c b/src/plugins/push-notification/push-notification-driver-dlog.c index ff6c499175..256340c70f 100644 --- a/src/plugins/push-notification/push-notification-driver-dlog.c +++ b/src/plugins/push-notification/push-notification-driver-dlog.c @@ -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); } diff --git a/src/plugins/push-notification/push-notification-drivers.c b/src/plugins/push-notification/push-notification-drivers.c index 67295d19ca..175ac74f09 100644 --- a/src/plugins/push-notification/push-notification-drivers.c +++ b/src/plugins/push-notification/push-notification-drivers.c @@ -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; diff --git a/src/plugins/push-notification/push-notification-event-flagsclear.c b/src/plugins/push-notification/push-notification-event-flagsclear.c index 2ce0c3f192..2109f3aeee 100644 --- a/src/plugins/push-notification/push-notification-event-flagsclear.c +++ b/src/plugins/push-notification/push-notification-event-flagsclear.c @@ -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 * diff --git a/src/plugins/push-notification/push-notification-event-flagsset.c b/src/plugins/push-notification/push-notification-event-flagsset.c index c596ced832..1292d9531a 100644 --- a/src/plugins/push-notification/push-notification-event-flagsset.c +++ b/src/plugins/push-notification/push-notification-event-flagsset.c @@ -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 * diff --git a/src/plugins/push-notification/push-notification-event-mailboxcreate.c b/src/plugins/push-notification/push-notification-event-mailboxcreate.c index 87e46c1fce..f518239a47 100644 --- a/src/plugins/push-notification/push-notification-event-mailboxcreate.c +++ b/src/plugins/push-notification/push-notification-event-mailboxcreate.c @@ -12,9 +12,10 @@ 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)); diff --git a/src/plugins/push-notification/push-notification-event-mailboxdelete.c b/src/plugins/push-notification/push-notification-event-mailboxdelete.c index 8e65f3cfb7..16e14ef6fb 100644 --- a/src/plugins/push-notification/push-notification-event-mailboxdelete.c +++ b/src/plugins/push-notification/push-notification-event-mailboxdelete.c @@ -11,9 +11,10 @@ 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 diff --git a/src/plugins/push-notification/push-notification-event-mailboxrename.c b/src/plugins/push-notification/push-notification-event-mailboxrename.c index e4c2cae060..c525827a7f 100644 --- a/src/plugins/push-notification/push-notification-event-mailboxrename.c +++ b/src/plugins/push-notification/push-notification-event-mailboxrename.c @@ -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); } diff --git a/src/plugins/push-notification/push-notification-event-mailboxsubscribe.c b/src/plugins/push-notification/push-notification-event-mailboxsubscribe.c index 0bcd101402..8f5927f7a0 100644 --- a/src/plugins/push-notification/push-notification-event-mailboxsubscribe.c +++ b/src/plugins/push-notification/push-notification-event-mailboxsubscribe.c @@ -12,9 +12,10 @@ 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 diff --git a/src/plugins/push-notification/push-notification-event-mailboxunsubscribe.c b/src/plugins/push-notification/push-notification-event-mailboxunsubscribe.c index b8d078f35e..1516d55509 100644 --- a/src/plugins/push-notification/push-notification-event-mailboxunsubscribe.c +++ b/src/plugins/push-notification/push-notification-event-mailboxunsubscribe.c @@ -12,9 +12,10 @@ 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 diff --git a/src/plugins/push-notification/push-notification-event-messageappend.c b/src/plugins/push-notification/push-notification-event-messageappend.c index b6e03187db..2fa8083a01 100644 --- a/src/plugins/push-notification/push-notification-event-messageappend.c +++ b/src/plugins/push-notification/push-notification-event-messageappend.c @@ -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 diff --git a/src/plugins/push-notification/push-notification-event-messageexpunge.c b/src/plugins/push-notification/push-notification-event-messageexpunge.c index cfa301e124..7920c88e26 100644 --- a/src/plugins/push-notification/push-notification-event-messageexpunge.c +++ b/src/plugins/push-notification/push-notification-event-messageexpunge.c @@ -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 diff --git a/src/plugins/push-notification/push-notification-event-messagenew.c b/src/plugins/push-notification/push-notification-event-messagenew.c index 930c0eeaf6..38fc414a3a 100644 --- a/src/plugins/push-notification/push-notification-event-messagenew.c +++ b/src/plugins/push-notification/push-notification-event-messagenew.c @@ -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 diff --git a/src/plugins/push-notification/push-notification-event-messageread.c b/src/plugins/push-notification/push-notification-event-messageread.c index 8f0d709923..a4307e38a3 100644 --- a/src/plugins/push-notification/push-notification-event-messageread.c +++ b/src/plugins/push-notification/push-notification-event-messageread.c @@ -13,9 +13,10 @@ 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 diff --git a/src/plugins/push-notification/push-notification-event-messagetrash.c b/src/plugins/push-notification/push-notification-event-messagetrash.c index 2284b6f136..ff8b9aeaae 100644 --- a/src/plugins/push-notification/push-notification-event-messagetrash.c +++ b/src/plugins/push-notification/push-notification-event-messagetrash.c @@ -13,9 +13,10 @@ 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