feat(NIP-11): relay_icon option added

This commit is contained in:
Václav Navrátil 2023-07-15 21:47:02 +02:00 committed by Greg Heartsfield
parent c50e10aa21
commit 70dfcb6a04
3 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -15,6 +15,7 @@ pub struct Info {
pub pubkey: Option<String>,
pub contact: Option<String>,
pub favicon: Option<String>,
pub relay_icon: Option<String>,
}
#[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 {

View File

@ -45,6 +45,8 @@ pub struct RelayInfo {
#[serde(skip_serializing_if = "Option::is_none")]
pub contact: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub icon: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_nips: Option<Vec<i64>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub software: Option<String>,
@ -124,6 +126,7 @@ impl From<Settings> for RelayInfo {
limitation: Some(limitations),
payment_url,
fees,
icon: i.relay_icon,
}
}
}