summaryrefslogtreecommitdiff
path: root/src/anastasis/anastasis-gtk_action.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-09-26 20:20:33 +0200
committerChristian Grothoff <christian@grothoff.org>2021-09-26 20:20:33 +0200
commit3e09498c42246a23632f0e3a30507612667f322c (patch)
treefd8fa23853e5b10bf5eb5405b03dacfbdfc681c1 /src/anastasis/anastasis-gtk_action.c
parent51a9affdef26baa5c9a8c6dc40f4ccd16259ea57 (diff)
downloadanastasis-gtk-3e09498c42246a23632f0e3a30507612667f322c.tar.gz
anastasis-gtk-3e09498c42246a23632f0e3a30507612667f322c.tar.bz2
anastasis-gtk-3e09498c42246a23632f0e3a30507612667f322c.zip
fix base32 encoder to match totp standard
Diffstat (limited to 'src/anastasis/anastasis-gtk_action.c')
-rw-r--r--src/anastasis/anastasis-gtk_action.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/anastasis/anastasis-gtk_action.c b/src/anastasis/anastasis-gtk_action.c
index 4f754b2..f36fa6e 100644
--- a/src/anastasis/anastasis-gtk_action.c
+++ b/src/anastasis/anastasis-gtk_action.c
@@ -2560,6 +2560,7 @@ render_feedback (GtkBuilder *builder,
const char *taler_pay_uri = NULL;
uint32_t ec = 0;
uint32_t http_status = 0;
+ bool hide = false;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("state",
&state),
@@ -2655,7 +2656,20 @@ render_feedback (GtkBuilder *builder,
else
{
const char *ihint;
+ const char *type = "Error";
+ switch (code)
+ {
+ case TALER_EC_ANASTASIS_TRUTH_CHALLENGE_RESPONSE_REQUIRED:
+ hide = true;
+ type = "Hint";
+ break;
+ case TALER_EC_ANASTASIS_TRUTH_CHALLENGE_ACTIVE:
+ type = "Hint";
+ break;
+ default:
+ break;
+ }
ihint = TALER_ErrorCode_get_hint (code);
if ( (NULL != hint) &&
( (NULL == ihint) ||
@@ -2667,11 +2681,13 @@ render_feedback (GtkBuilder *builder,
{
if (NULL == ihint)
GNUNET_asprintf (&msg,
- "Error #%u",
+ "%s #%u",
+ type,
(unsigned int) code);
else
GNUNET_asprintf (&msg,
- "Error #%u: %s",
+ "%s #%u: %s",
+ type,
(unsigned int) code,
ihint);
}
@@ -2679,12 +2695,14 @@ render_feedback (GtkBuilder *builder,
{
if (NULL == ihint)
GNUNET_asprintf (&msg,
- "Error #%u (%s)",
+ "%s #%u (%s)",
+ type,
(unsigned int) code,
detail);
else
GNUNET_asprintf (&msg,
- "Error #%u: %s (%s)",
+ "%s #%u: %s (%s)",
+ type,
(unsigned int) code,
ihint,
detail);
@@ -2701,7 +2719,10 @@ render_feedback (GtkBuilder *builder,
gtk_label_set_text (elabel,
msg);
GNUNET_free (msg);
- gtk_widget_show (GTK_WIDGET (elabel));
+ if (hide)
+ gtk_widget_hide (GTK_WIDGET (elabel));
+ else
+ gtk_widget_show (GTK_WIDGET (elabel));
GNUNET_JSON_parse_free (spec);
}