From 70dfcb6a0419196ef9000848a0a7bed4bd105e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Navr=C3=A1til?= Date: Sat, 15 Jul 2023 21:47:02 +0200 Subject: [PATCH] feat(NIP-11): relay_icon option added --- config.toml | 3 +++ src/config.rs | 2 ++ src/info.rs | 3 +++ 3 files changed, 8 insertions(+) diff --git a/config.toml b/config.toml index ef5f68d..6a78aba 100644 --- a/config.toml +++ b/config.toml @@ -20,6 +20,9 @@ description = "A newly created nostr-rs-relay.\n\nCustomize this with your own i # ICO format. #favicon = "favicon.ico" +# URL of Relay's icon. +#relay_icon = "https://example.test/img.png" + [diagnostics] # Enable tokio tracing (for use with tokio-console) #tracing = false diff --git a/src/config.rs b/src/config.rs index 03cc243..c5ead74 100644 --- a/src/config.rs +++ b/src/config.rs @@ -15,6 +15,7 @@ pub struct Info { pub pubkey: Option, pub contact: Option, pub favicon: Option, + pub relay_icon: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -268,6 +269,7 @@ impl Default for Settings { pubkey: None, contact: None, favicon: None, + relay_icon: None, }, diagnostics: Diagnostics { tracing: false }, database: Database { diff --git a/src/info.rs b/src/info.rs index d2233ca..35f6430 100644 --- a/src/info.rs +++ b/src/info.rs @@ -45,6 +45,8 @@ pub struct RelayInfo { #[serde(skip_serializing_if = "Option::is_none")] pub contact: Option, #[serde(skip_serializing_if = "Option::is_none")] + pub icon: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub supported_nips: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub software: Option, @@ -124,6 +126,7 @@ impl From for RelayInfo { limitation: Some(limitations), payment_url, fees, + icon: i.relay_icon, } } }