chore(nostr): A function to add user read relays to a vector

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb
2025-05-18 08:58:13 +00:00
parent a9b088d8a5
commit 661266c67b

View File

@@ -165,4 +165,16 @@ impl NostrClient {
.await?
.map(|e| e.pubkey))
}
/// Adds read relays from the user to the given vector of relays.
pub async fn read_relays_from_user(
&self,
vector: Vec<RelayUrl>,
user: PublicKey,
) -> Vec<RelayUrl> {
utils::add_read_relays(
vector,
self.user_relays_list(user).await.ok().flatten().as_ref(),
)
}
}