feat: replace email with contact field in relay info.

This finalizes the NIP-11 spec implementation.

Fixes https://todo.sr.ht/~gheartsfield/nostr-rs-relay/21.
This commit is contained in:
Greg Heartsfield 2022-01-16 08:34:19 -06:00
parent c7eadb1154
commit 030b64de62
3 changed files with 6 additions and 6 deletions

View File

@ -13,8 +13,8 @@ description = "A newly created nostr-rs-relay.\n\nCustomize this with your own i
# Administrative contact pubkey
#pubkey = "0c2d168a4ae8ca58c9f1ab237b5df682599c6c7ab74307ea8b05684b60405d41"
# Administrative contact email
#email = "contact@example.com"
# Administrative contact URI
#contact = "mailto:contact@example.com"
[database]
# Directory for SQLite files. Defaults to the current directory. Can

View File

@ -15,7 +15,7 @@ pub struct Info {
pub name: Option<String>,
pub description: Option<String>,
pub pubkey: Option<String>,
pub email: Option<String>,
pub contact: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
@ -105,7 +105,7 @@ impl Default for Settings {
name: Some("Unnamed nostr-rs-relay".to_owned()),
description: None,
pubkey: None,
email: None,
contact: None,
},
database: Database {
data_directory: ".".to_owned(),

View File

@ -16,7 +16,7 @@ pub struct RelayInfo {
#[serde(skip_serializing_if = "Option::is_none")]
pub pubkey: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
pub contact: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_nips: Option<Vec<i64>>,
#[serde(skip_serializing_if = "Option::is_none")]
@ -33,7 +33,7 @@ impl From<config::Info> for RelayInfo {
name: i.name,
description: i.description,
pubkey: i.pubkey,
email: i.email,
contact: i.contact,
supported_nips: Some(vec![1]),
software: Some("https://git.sr.ht/~gheartsfield/nostr-rs-relay".to_owned()),
version: CARGO_PKG_VERSION.map(|x| x.to_owned()),