commit d780b900d65c2f3c2f14fa7ae68c6d86689c9b11
parent 14bec28b6a485beae1e1ecd4d1a29a0dae07546a
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Tue, 10 Mar 2026 10:31:48 +0100
also truncate payto in text message (#11221)
Diffstat:
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/contrib/kyc_text.en.must b/contrib/kyc_text.en.must
@@ -3,7 +3,7 @@ GNU Taler Merchant — Compliance Onboarding Status
{{#kyc_data}}
────────────────────────────────────────
-Your account : {{payto_uri}}
+Your account : {{short_payto_uri}}
Payment service: {{exchange_url}}
Currency : {{exchange_currency}}
────────────────────────────────────────
diff --git a/src/backend/taler-merchant-httpd_get-private-kyc.c b/src/backend/taler-merchant-httpd_get-private-kyc.c
@@ -835,8 +835,11 @@ map_to_status (const struct ExchangeKycRequest *ekr)
static void
ekr_expand_response (struct ExchangeKycRequest *ekr)
{
+ const struct KycContext *kc = ekr->kc;
struct TMH_Exchange *e = TMH_EXCHANGES_lookup_exchange (ekr->exchange_url);
const char *status;
+ const char *q;
+ char *short_account;
GNUNET_assert (NULL != e);
status = map_to_status (ekr);
@@ -847,12 +850,23 @@ ekr_expand_response (struct ExchangeKycRequest *ekr)
}
clear_status (ekr->kc,
status);
+ q = strchr (ekr->payto_uri.full_payto,
+ '?');
+ if (NULL == q)
+ short_account = GNUNET_strdup (ekr->payto_uri.full_payto);
+ else
+ short_account = GNUNET_strndup (ekr->payto_uri.full_payto,
+ q - ekr->payto_uri.full_payto);
GNUNET_assert (
0 ==
json_array_append_new (
ekr->kc->kycs_data,
GNUNET_JSON_PACK (
- TALER_JSON_pack_full_payto (
+ (POF_TEXT == kc->format)
+ ? GNUNET_JSON_pack_string (
+ "short_payto_uri",
+ short_account)
+ : TALER_JSON_pack_full_payto (
"payto_uri",
ekr->payto_uri),
GNUNET_JSON_pack_data_auto (
@@ -896,6 +910,7 @@ ekr_expand_response (struct ExchangeKycRequest *ekr)
GNUNET_JSON_pack_array_incref ("payto_kycauths",
ekr->pkaa))
)));
+ GNUNET_free (short_account);
}