mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-22 17:19:07 -05:00
fix: never display hidden events
This commit is contained in:
parent
f1206e76f2
commit
a72eaec3b8
|
@ -612,16 +612,17 @@ fn query_from_sub(sub: &Subscription) -> (String, Vec<Box<dyn ToSql>>) {
|
||||||
fc.push_str(&filter_components.join(" AND "));
|
fc.push_str(&filter_components.join(" AND "));
|
||||||
fc.push_str(" )");
|
fc.push_str(" )");
|
||||||
filter_clauses.push(fc);
|
filter_clauses.push(fc);
|
||||||
} else {
|
|
||||||
// never display hidden events
|
|
||||||
filter_clauses.push("hidden!=TRUE".to_owned());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// never display hidden events
|
||||||
|
query.push_str(" WHERE hidden!=TRUE ");
|
||||||
|
|
||||||
// combine all filters with OR clauses, if any exist
|
// combine all filters with OR clauses, if any exist
|
||||||
if !filter_clauses.is_empty() {
|
if !filter_clauses.is_empty() {
|
||||||
query.push_str(" WHERE ");
|
query.push_str(" AND (");
|
||||||
query.push_str(&filter_clauses.join(" OR "));
|
query.push_str(&filter_clauses.join(" OR "));
|
||||||
|
query.push_str(") ");
|
||||||
}
|
}
|
||||||
// add order clause
|
// add order clause
|
||||||
query.push_str(" ORDER BY created_at ASC");
|
query.push_str(" ORDER BY created_at ASC");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user