wip disable payment uri labels globally

This commit is contained in:
woodser 2025-06-03 05:55:08 -04:00
parent 655b233365
commit 23d1b8059a
No known key found for this signature in database
GPG key ID: 55A10DD48ADEE5EF
2 changed files with 7 additions and 8 deletions

View file

@ -368,10 +368,7 @@ public class DepositView extends ActivatableView<VBox, Void> {
@NotNull
private String getPaymentUri() {
return MoneroUtils.getPaymentUri(new MoneroTxConfig()
.setAddress(addressTextField.getAddress())
.setAmount(HavenoUtils.coinToAtomicUnits(getAmount()))
.setNote(paymentLabelString));
return GUIUtil.getMoneroURI(addressTextField.getAddress(), HavenoUtils.coinToAtomicUnits(getAmount()), paymentLabelString);
}
///////////////////////////////////////////////////////////////////////////////////////////

View file

@ -147,6 +147,8 @@ public class GUIUtil {
public final static int AMOUNT_DECIMALS_WITH_ZEROS = 3;
public final static int AMOUNT_DECIMALS = 4;
public static final boolean disablePaymentUriLabel = true; // universally disable payment uri labels, allowing bigger xmr logo overlays
private static Preferences preferences;
public static void setPreferences(Preferences preferences) {
@ -711,10 +713,10 @@ public class GUIUtil {
}
public static String getMoneroURI(String address, BigInteger amount, String label) {
return MoneroUtils.getPaymentUri(new MoneroTxConfig()
.setAddress(address)
.setAmount(amount)
.setNote(label));
MoneroTxConfig txConfig = new MoneroTxConfig().setAddress(address);
if (amount != null) txConfig.setAmount(amount);
if (label != null && !label.isEmpty() && !disablePaymentUriLabel) txConfig.setNote(label);
return MoneroUtils.getPaymentUri(txConfig);
}
public static boolean isBootstrappedOrShowPopup(P2PService p2PService) {