feat: remove author from subscriptions (NIP-01 Spec)

The `authors` field is sufficient to represent all queries that
`author` could have been used in.  See
https://github.com/fiatjaf/nostr/issues/34 for the discussion leading
to this removal.
This commit is contained in:
Greg Heartsfield
2021-12-16 18:53:53 -06:00
parent acf6231277
commit 5b6a20dfa6
2 changed files with 2 additions and 48 deletions
-10
View File
@@ -181,16 +181,6 @@ fn query_from_sub(sub: &Subscription) -> String {
for f in sub.filters.iter() {
// individual filter components
let mut filter_components: Vec<String> = Vec::new();
// Query for "author"
// https://github.com/fiatjaf/nostr/issues/34
// I believe the author & authors fields are redundant.
if f.author.is_some() {
let author_str = f.author.as_ref().unwrap();
if is_hex(author_str) {
let author_clause = format!("author = x'{}'", author_str);
filter_components.push(author_clause);
}
}
// Query for "authors"
if f.authors.is_some() {
let authors_escaped: Vec<String> = f