diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2023-07-31 18:32:47 +0200 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2023-07-31 18:32:47 +0200 |
commit | fcec3bc2d446707329ae1a1f13ce9071b5b5a7e6 (patch) | |
tree | 8f396a49386520f0e141d90943b5ea7bbde36cae | |
parent | ed40031a8e69b691cce08610dd13e07df59cd1b1 (diff) | |
download | anastasis-gtk-fcec3bc2d446707329ae1a1f13ce9071b5b5a7e6.tar.gz anastasis-gtk-fcec3bc2d446707329ae1a1f13ce9071b5b5a7e6.tar.bz2 anastasis-gtk-fcec3bc2d446707329ae1a1f13ce9071b5b5a7e6.zip |
adjustments to future-proofed anastasis-core API
-rw-r--r-- | src/anastasis/anastasis-gtk_handle-add-provider.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/anastasis/anastasis-gtk_handle-add-provider.c b/src/anastasis/anastasis-gtk_handle-add-provider.c index 3815eb6..2d493a0 100644 --- a/src/anastasis/anastasis-gtk_handle-add-provider.c +++ b/src/anastasis/anastasis-gtk_handle-add-provider.c @@ -47,12 +47,10 @@ static struct ANASTASIS_ConfigOperation *co; * the server provided an acceptable response. * * @param cls closure with our `GtkBuilder *` - * @param http_status the HTTP status * @param acfg configuration obtained, NULL if we could not parse it */ static void config_cb (void *cls, - unsigned int http_status, const struct ANASTASIS_Config *acfg) { GtkBuilder *builder = GTK_BUILDER (cls); @@ -63,18 +61,17 @@ config_cb (void *cls, co = NULL; l = GTK_LABEL (gtk_builder_get_object (builder, "error_label")); - if ( (MHD_HTTP_OK != http_status) || - (NULL == acfg) ) + if (MHD_HTTP_OK != acfg->http_status) { char *msg; - if (0 == http_status) + if (0 == acfg->http_status) GNUNET_asprintf (&msg, "Provider URL invalid (no response)"); else GNUNET_asprintf (&msg, "Provider URL invalid (HTTP status %u)", - http_status); + acfg->http_status); gtk_widget_show (GTK_WIDGET (l)); gtk_label_set_text (l, msg); @@ -83,10 +80,10 @@ config_cb (void *cls, } methods_list = json_array (); GNUNET_assert (NULL != methods_list); - for (unsigned int i = 0; i<acfg->methods_length; i++) + for (unsigned int i = 0; i<acfg->details.ok.methods_length; i++) { const struct ANASTASIS_AuthorizationMethodConfig *method - = &acfg->methods[i]; + = &acfg->details.ok.methods[i]; json_t *mj = GNUNET_JSON_PACK ( GNUNET_JSON_pack_string ("type", method->type), @@ -101,23 +98,23 @@ config_cb (void *cls, GNUNET_JSON_pack_array_steal ("methods", methods_list), TALER_JSON_pack_amount ("annual_fee", - &acfg->annual_fee), + &acfg->details.ok.annual_fee), TALER_JSON_pack_amount ("truth_upload_fee", - &acfg->truth_upload_fee), + &acfg->details.ok.truth_upload_fee), TALER_JSON_pack_amount ("liability_limit", - &acfg->liability_limit), + &acfg->details.ok.liability_limit), GNUNET_JSON_pack_string ("business_name", - acfg->business_name), + acfg->details.ok.business_name), GNUNET_JSON_pack_string ("status", "enabled"), GNUNET_JSON_pack_uint64 ("http_status", MHD_HTTP_OK), GNUNET_JSON_pack_uint64 ("storage_limit_in_megabytes", - acfg->storage_limit_in_megabytes), + acfg->details.ok.storage_limit_in_megabytes), GNUNET_JSON_pack_data_auto ("provider_salt", - &acfg->provider_salt), + &acfg->details.ok.provider_salt), GNUNET_JSON_pack_uint64 ("http_status", - http_status)); + acfg->http_status)); button = GTK_WIDGET (gtk_builder_get_object (builder, "add_button")); gtk_widget_set_sensitive (button, |