gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated: consistently give display_name


From: gnunet
Subject: [taler-anastasis] branch master updated: consistently give display_name human-readable translated hints
Date: Sat, 05 Mar 2022 21:57:49 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new eac90da  consistently give display_name human-readable translated hints
eac90da is described below

commit eac90da9bc7db641b91d364586de856dac6faaef
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Mar 5 21:57:46 2022 +0100

    consistently give display_name human-readable translated hints
---
 src/reducer/anastasis_api_recovery_redux.c | 41 +++++++++++++++++-------------
 1 file changed, 24 insertions(+), 17 deletions(-)

diff --git a/src/reducer/anastasis_api_recovery_redux.c 
b/src/reducer/anastasis_api_recovery_redux.c
index f783195..0e81e5a 100644
--- a/src/reducer/anastasis_api_recovery_redux.c
+++ b/src/reducer/anastasis_api_recovery_redux.c
@@ -536,16 +536,21 @@ start_feedback_cb (
   case ANASTASIS_CHALLENGE_START_STATUS_FILENAME_PROVIDED:
     {
       json_t *instructions;
+      char *hint;
 
+      GNUNET_asprintf (&hint,
+                       _ ("Required TAN can be found in `%s'"),
+                       csr->details.tan_filename);
       instructions = GNUNET_JSON_PACK (
         GNUNET_JSON_pack_string ("state",
                                  "code-in-file"),
         GNUNET_JSON_pack_string ("filename",
                                  csr->details.tan_filename),
         GNUNET_JSON_pack_string ("display_hint",
-                                 csr->details.tan_filename),
+                                 hint),
         GNUNET_JSON_pack_uint64 ("http_status",
                                  (json_int_t) csr->http_status));
+      GNUNET_free (hint);
       GNUNET_assert (0 ==
                      json_object_set_new (feedback,
                                           uuid,
@@ -561,16 +566,21 @@ start_feedback_cb (
   case ANASTASIS_CHALLENGE_START_STATUS_TAN_SENT_HINT_PROVIDED:
     {
       json_t *instructions;
+      char *hint;
 
+      GNUNET_asprintf (&hint,
+                       _ ("TAN code was sent to `%s'"),
+                       csr->details.tan_address_hint);
       instructions = GNUNET_JSON_PACK (
         GNUNET_JSON_pack_string ("state",
                                  "send-to-address"),
         GNUNET_JSON_pack_string ("address_hint",
                                  csr->details.tan_address_hint),
         GNUNET_JSON_pack_string ("display_hint",
-                                 csr->details.tan_address_hint),
+                                 hint),
         GNUNET_JSON_pack_uint64 ("http_status",
                                  (json_int_t) csr->http_status));
+      GNUNET_free (hint);
       GNUNET_assert (0 ==
                      json_object_set_new (feedback,
                                           uuid,
@@ -586,7 +596,11 @@ start_feedback_cb (
   case ANASTASIS_CHALLENGE_START_STATUS_PAYMENT_REQUIRED:
     {
       json_t *pay;
+      char *hint;
 
+      GNUNET_asprintf (&hint,
+                       _ ("Taler payment to `%s' required"),
+                       csr->details.payment_required.taler_pay_uri);
       pay = GNUNET_JSON_PACK (
         GNUNET_JSON_pack_string ("state",
                                  "taler-payment"),
@@ -596,10 +610,11 @@ start_feedback_cb (
         GNUNET_JSON_pack_string ("provider",
                                  cd->provider_url),
         GNUNET_JSON_pack_string ("display_hint",
-                                 csr->details.payment_required.taler_pay_uri),
+                                 hint),
         GNUNET_JSON_pack_data_auto (
           "payment_secret",
           &csr->details.payment_required.payment_secret));
+      GNUNET_free (hint);
       GNUNET_assert (0 ==
                      json_object_set_new (feedback,
                                           uuid,
@@ -632,9 +647,6 @@ start_feedback_cb (
       err = GNUNET_JSON_PACK (
         GNUNET_JSON_pack_string ("state",
                                  "server-failure"),
-        GNUNET_JSON_pack_string (
-          "display_hint",
-          _ ("The Anastasis provider experienced a failure")),
         GNUNET_JSON_pack_uint64 ("http_status",
                                  csr->http_status),
         GNUNET_JSON_pack_uint64 ("error_code",
@@ -660,9 +672,6 @@ start_feedback_cb (
                                  "truth-unknown"),
         GNUNET_JSON_pack_uint64 ("http_status",
                                  csr->http_status),
-        GNUNET_JSON_pack_string (
-          "display_hint",
-          _ ("The provider does not have the requested information")),
         GNUNET_JSON_pack_uint64 ("error_code",
                                  TALER_EC_ANASTASIS_TRUTH_UNKNOWN));
       GNUNET_assert (0 ==
@@ -840,8 +849,6 @@ answer_feedback_cb (
       instructions = GNUNET_JSON_PACK (
         GNUNET_JSON_pack_string ("status",
                                  "incorrect-answer"),
-        GNUNET_JSON_pack_string ("display_hint",
-                                 _ ("The provided answer was incorrect")),
         GNUNET_JSON_pack_uint64 ("error_code",
                                  csr->ec),
         GNUNET_JSON_pack_uint64 ("http_status",
@@ -861,7 +868,11 @@ answer_feedback_cb (
   case ANASTASIS_CHALLENGE_ANSWER_STATUS_PAYMENT_REQUIRED:
     {
       json_t *pay;
+      char *hint;
 
+      GNUNET_asprintf (&hint,
+                       _ ("Taler payment to `%s' required"),
+                       csr->details.payment_required.taler_pay_uri);
       pay = GNUNET_JSON_PACK (
         GNUNET_JSON_pack_string ("state",
                                  "taler-payment"),
@@ -870,12 +881,13 @@ answer_feedback_cb (
           csr->details.payment_required.taler_pay_uri),
         GNUNET_JSON_pack_string (
           "display_hint",
-          csr->details.payment_required.taler_pay_uri),
+          hint),
         GNUNET_JSON_pack_string ("provider",
                                  cd->provider_url),
         GNUNET_JSON_pack_data_auto (
           "payment_secret",
           &csr->details.payment_required.payment_secret));
+      GNUNET_free (hint);
       GNUNET_assert (0 ==
                      json_object_set_new (feedback,
                                           uuid,
@@ -908,9 +920,6 @@ answer_feedback_cb (
       err = GNUNET_JSON_PACK (
         GNUNET_JSON_pack_string ("state",
                                  "server-failure"),
-        GNUNET_JSON_pack_string (
-          "display_hint",
-          _ ("The Anastasis provider experienced a failure")),
         GNUNET_JSON_pack_uint64 ("http_status",
                                  csr->http_status),
         GNUNET_JSON_pack_uint64 ("error_code",
@@ -936,8 +945,6 @@ answer_feedback_cb (
                                  "truth-unknown"),
         GNUNET_JSON_pack_uint64 ("http_status",
                                  csr->http_status),
-        GNUNET_JSON_pack_string ("display_hint",
-                                 TALER_ErrorCode_get_hint (csr->ec)),
         GNUNET_JSON_pack_uint64 ("error_code",
                                  TALER_EC_ANASTASIS_TRUTH_UNKNOWN));
       GNUNET_assert (0 ==

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]