From: Karl Fleischmann Date: Thu, 14 Sep 2023 09:09:58 +0000 (+0200) Subject: plugins/push-notification: push_notification_driver_ox_init_global() - Move HTTP... X-Git-Tag: 2.4.1~1349 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc13eb473ace104eb036c621a40bd309ab286e46;p=thirdparty%2Fdovecot%2Fcore.git plugins/push-notification: push_notification_driver_ox_init_global() - Move HTTP client initialization into init-callback This commit makes the HTTP client initialization and propagation of potential errors into the init-callback of the push notification drivers, instead of deferring it to the message handling. --- diff --git a/src/plugins/push-notification/push-notification-driver-ox.c b/src/plugins/push-notification/push-notification-driver-ox.c index 87e303cb19..e688b492b4 100644 --- a/src/plugins/push-notification/push-notification-driver-ox.c +++ b/src/plugins/push-notification/push-notification-driver-ox.c @@ -132,6 +132,10 @@ push_notification_driver_ox_init(struct mail_user *user, pool_t pool, *context = dconfig; settings_free(ox_settings); + + if (!push_notification_driver_ox_init_global(user, name)) + return -1; + return 0; } @@ -367,9 +371,6 @@ push_notification_driver_ox_process_msg( if (messagenew == NULL) return; - if (!push_notification_driver_ox_init_global(user)) - return; - http_req = http_client_request_url( ox_global->http_client, "PUT", dconfig->http_url, push_notification_driver_ox_http_callback, dconfig);