]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
plugins/push-notification: push_notification_driver_ox_init_global() - Move HTTP...
authorKarl Fleischmann <karl.fleischmann@open-xchange.com>
Thu, 14 Sep 2023 09:09:58 +0000 (11:09 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:10 +0000 (12:34 +0200)
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.

src/plugins/push-notification/push-notification-driver-ox.c

index 87e303cb1958fe81d07311c0a9a1294ad7dcadc8..e688b492b47fda442046fa560b736263aacd8d4b 100644 (file)
@@ -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);