rm nip 113
This commit is contained in:
parent
fe46959424
commit
aa430de168
@ -1,4 +1,3 @@
|
|||||||
export enum Nips {
|
export enum Nips {
|
||||||
Search = 50,
|
Search = 50,
|
||||||
NotFilter = 113,
|
|
||||||
}
|
}
|
||||||
|
@ -122,20 +122,6 @@ export class QueryManager extends EventEmitter<QueryManagerEvents> {
|
|||||||
}
|
}
|
||||||
qSend.filters = fNew;
|
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) {
|
if (qSend.relay) {
|
||||||
this.#log("Sending query to %s %s %O", qSend.relay, q.id, qSend);
|
this.#log("Sending query to %s %s %O", qSend.relay, q.id, qSend);
|
||||||
const s = this.#system.pool.getConnection(qSend.relay);
|
const s = this.#system.pool.getConnection(qSend.relay);
|
||||||
|
@ -380,16 +380,7 @@ export class Query extends EventEmitter<QueryEvents> {
|
|||||||
|
|
||||||
#sendQueryInternal(c: Connection, q: BuiltRawReqFilter) {
|
#sendQueryInternal(c: Connection, q: BuiltRawReqFilter) {
|
||||||
let filters = q.filters;
|
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);
|
const qt = new QueryTrace(c.Address, filters, c.Id);
|
||||||
qt.on("close", x => c.CloseReq(x));
|
qt.on("close", x => c.CloseReq(x));
|
||||||
qt.on("change", () => this.#onProgress());
|
qt.on("change", () => this.#onProgress());
|
||||||
|
Loading…
Reference in New Issue
Block a user