mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-22 00:59:07 -05:00
perf(NIP-26): temporarily disable NIP-26 delegated events
This commit is contained in:
parent
39a945b493
commit
e9d2a2cbd0
29
src/db.rs
29
src/db.rs
|
@ -548,34 +548,9 @@ fn query_from_filter(f: &ReqFilter) -> (String, Vec<Box<dyn ToSql>>) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// take each author and convert to a hexsearch
|
|
||||||
let mut del_searches: Vec<String> = vec![];
|
|
||||||
for auth in authvec {
|
|
||||||
match hex_range(auth) {
|
|
||||||
Some(HexSearch::Exact(ex)) => {
|
|
||||||
del_searches.push("delegated_by=?".to_owned());
|
|
||||||
params.push(Box::new(ex));
|
|
||||||
}
|
|
||||||
Some(HexSearch::Range(lower, upper)) => {
|
|
||||||
del_searches.push(
|
|
||||||
"(delegated_by>? AND delegated_by<?)".to_owned(),
|
|
||||||
);
|
|
||||||
params.push(Box::new(lower));
|
|
||||||
params.push(Box::new(upper));
|
|
||||||
}
|
|
||||||
Some(HexSearch::LowerOnly(lower)) => {
|
|
||||||
del_searches.push("delegated_by>?".to_owned());
|
|
||||||
params.push(Box::new(lower));
|
|
||||||
}
|
|
||||||
None => {
|
|
||||||
info!("Could not parse hex range from author {:?}", auth);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !authvec.is_empty() {
|
if !authvec.is_empty() {
|
||||||
// combine auth_searches and del_searches
|
let auth_clause = format!("({})", auth_searches.join(" OR "));
|
||||||
let comb_clause = format!("({} OR {})", auth_searches.join(" OR "), del_searches.join(" OR "));
|
filter_components.push(auth_clause);
|
||||||
filter_components.push(comb_clause);
|
|
||||||
} else {
|
} else {
|
||||||
filter_components.push("false".to_owned());
|
filter_components.push("false".to_owned());
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ impl From<config::Info> for RelayInfo {
|
||||||
description: i.description,
|
description: i.description,
|
||||||
pubkey: i.pubkey,
|
pubkey: i.pubkey,
|
||||||
contact: i.contact,
|
contact: i.contact,
|
||||||
supported_nips: Some(vec![1, 2, 9, 11, 12, 15, 16, 20, 22, 26]),
|
supported_nips: Some(vec![1, 2, 9, 11, 12, 15, 16, 20, 22]),
|
||||||
software: Some("https://git.sr.ht/~gheartsfield/nostr-rs-relay".to_owned()),
|
software: Some("https://git.sr.ht/~gheartsfield/nostr-rs-relay".to_owned()),
|
||||||
version: CARGO_PKG_VERSION.map(|x| x.to_owned()),
|
version: CARGO_PKG_VERSION.map(|x| x.to_owned()),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user