rm nip 113

This commit is contained in:
Martti Malmi 2024-01-15 10:23:00 +02:00
parent fe46959424
commit aa430de168
3 changed files with 1 additions and 25 deletions

View File

@ -1,4 +1,3 @@
export enum Nips {
Search = 50,
NotFilter = 113,
}

View File

@ -122,20 +122,6 @@ export class QueryManager extends EventEmitter<QueryManagerEvents> {
}
qSend.filters = fNew;
const alreadyHave = new Set<string>();
qSend.filters.forEach(f => {
// check what we already have locally
q.feed.takeSnapshot().forEach(e => alreadyHave.add(e.id));
if (alreadyHave.size) {
f.not = f.not || {};
f.not.ids = f.not.ids || [];
// if there's multiple filters in the query, should we only add alreadyHave events that actually match the filter?
f.not.ids.push(...alreadyHave);
console.log("already have", f, alreadyHave);
}
// query relays one at a time at intervals, updating alreadyHave in between?
});
if (qSend.relay) {
this.#log("Sending query to %s %s %O", qSend.relay, q.id, qSend);
const s = this.#system.pool.getConnection(qSend.relay);

View File

@ -380,16 +380,7 @@ export class Query extends EventEmitter<QueryEvents> {
#sendQueryInternal(c: Connection, q: BuiltRawReqFilter) {
let filters = q.filters;
if (!c.SupportsNip(Nips.NotFilter)) {
filters = filters.map(f => {
if (f.not) {
const copy = { ...f };
delete copy.not;
return copy;
}
return f;
});
}
const qt = new QueryTrace(c.Address, filters, c.Id);
qt.on("close", x => c.CloseReq(x));
qt.on("change", () => this.#onProgress());