Skip to content

Commit

Permalink
fix typo in relay information about payments url (#15)
Browse files Browse the repository at this point in the history
* fix typo in relay information about payments url

* Update info.rs

---------

Co-authored-by: mroxso <[email protected]>
  • Loading branch information
mroxso and mroxso authored Feb 10, 2024
1 parent 60380c4 commit 9c71e87
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub struct RelayInfo {
#[serde(skip_serializing_if = "Option::is_none")]
pub limitation: Option<Limitation>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_url: Option<String>,
pub payments_url: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub fees: Option<Fees>,
}
Expand Down Expand Up @@ -86,7 +86,7 @@ impl From<Settings> for RelayInfo {
),
};

let (payment_url, fees) = if p.enabled {
let (payments_url, fees) = if p.enabled {
let admission_fee = if p.admission_cost > 0 {
Some(vec![Fee {
amount: p.admission_cost * 1000,
Expand All @@ -110,15 +110,15 @@ impl From<Settings> for RelayInfo {
publication: post_fee,
};

let payment_url = if p.enabled && i.relay_url.is_some() {
let payments_url = if p.enabled && i.relay_url.is_some() {
Some(format!(
"{}join",
i.relay_url.clone().unwrap().replace("ws", "http")
))
} else {
None
};
(payment_url, Some(fees))
(payments_url, Some(fees))
} else {
(None, None)
};
Expand All @@ -130,10 +130,10 @@ impl From<Settings> for RelayInfo {
pubkey: i.pubkey,
contact: i.contact,
supported_nips: Some(supported_nips),
software: Some("https://github.com/mroxso/nostr-rs-relay".to_owned()),
software: Some("https://git.sr.ht/~gheartsfield/nostr-rs-relay".to_owned()),
version: CARGO_PKG_VERSION.map(std::borrow::ToOwned::to_owned),
limitation: Some(limitations),
payment_url,
payments_url,
fees,
icon: i.relay_icon,
}
Expand Down

0 comments on commit 9c71e87

Please sign in to comment.