From 4ff77ab537007eb4d6a8e251b4da2e202ead46aa Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Mon, 13 Nov 2023 08:24:59 +0000 Subject: [PATCH] improvement: config to disable dm/invoice creation While sending dms to users who are not signed up but have attempted to publish events, it is now disabled by default. This stops the creation of extra invoices for pubkeys that may have no intention of signing up for the relay. It also reduced the number of dms that are created. Signed-off-by: Greg Heartsfield --- config.toml | 2 +- src/config.rs | 2 +- src/db.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.toml b/config.toml index f0a052b..109efd2 100644 --- a/config.toml +++ b/config.toml @@ -206,7 +206,7 @@ reject_future_seconds = 1800 #api_secret = "" # Nostr direct message on signup -#direct_message=true +#direct_message=false # Terms of service #terms_message = """ diff --git a/src/config.rs b/src/config.rs index 9222821..52f0922 100644 --- a/src/config.rs +++ b/src/config.rs @@ -320,7 +320,7 @@ impl Default for Settings { node_url: "".to_string(), api_secret: "".to_string(), sign_ups: false, - direct_message: true, + direct_message: false, secret_key: None, processor: Processor::LNBits, }, diff --git a/src/db.rs b/src/db.rs index d0843fd..ee31735 100644 --- a/src/db.rs +++ b/src/db.rs @@ -261,7 +261,7 @@ pub async fn db_writer( ) => { // User does not exist info!("Unregistered user"); - if settings.pay_to_relay.sign_ups { + if settings.pay_to_relay.sign_ups && settings.pay_to_relay.direct_message { payment_tx .send(PaymentMessage::NewAccount(event.pubkey)) .ok();