This commit is contained in:
2024-10-05 08:49:09 +07:00
parent 8398ae80d3
commit d841163ba7
28 changed files with 527 additions and 461 deletions

View File

@@ -290,13 +290,7 @@ pub async fn get_group_events(
let authors: Vec<PublicKey> = public_keys
.iter()
.map(|p| {
if p.starts_with("npub1") {
PublicKey::from_bech32(p).map_err(|err| err.to_string())
} else {
PublicKey::from_hex(p).map_err(|err| err.to_string())
}
})
.map(|p| PublicKey::from_str(p).map_err(|err| err.to_string()))
.collect::<Result<Vec<_>, _>>()?;
let filter = Filter::new()
@@ -340,6 +334,7 @@ pub async fn get_global_events(
state: State<'_, Nostr>,
) -> Result<Vec<RichEvent>, String> {
let client = &state.client;
let as_of = match until {
Some(until) => Timestamp::from_str(until).map_err(|err| err.to_string())?,
None => Timestamp::now(),