mirror of
https://github.com/Yonle/bostr.git
synced 2025-06-18 12:50:49 +02:00
bouncer: bring these checkers back.
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
parent
579b800466
commit
15fe2e7dcd
@ -209,8 +209,15 @@ function newConn(addr, client, reconn_t = 0) {
|
|||||||
if (client.pause_subs.has(data[1])) return;
|
if (client.pause_subs.has(data[1])) return;
|
||||||
|
|
||||||
const cFilter = {...client.subs.get(data[1])};
|
const cFilter = {...client.subs.get(data[1])};
|
||||||
const NotInSearchQuery = "search" in cFilter && !data[2]?.content?.toLowerCase().includes(cFilter.search.toLowerCase());
|
// if filter.since > receivedEvent.created_at, skip
|
||||||
|
// if receivedEvent.created_at > filter.until, skip
|
||||||
|
if (Array.isArray(cFilter?.ids) && !cFilter.ids.includes(data[2].id)) return;
|
||||||
|
if (Array.isArray(cFilter?.authors) && !cFilter.authors.includes(data[2].pubkey)) return;
|
||||||
|
if (Array.isArray(cFilter?.kinds) && !cFilter.kinds.includes(data[2].kind)) return;
|
||||||
|
if (cFilter?.since > data[2].created_at) return;
|
||||||
|
if (data[2].created_at > cFilter?.until) return;
|
||||||
|
|
||||||
|
const NotInSearchQuery = "search" in cFilter && !data[2]?.content?.toLowerCase().includes(cFilter.search.toLowerCase());
|
||||||
if (NotInSearchQuery) return;
|
if (NotInSearchQuery) return;
|
||||||
if (client.events.get(data[1]).has(data[2]?.id)) return; // No need to transmit once it has been transmitted before.
|
if (client.events.get(data[1]).has(data[2]?.id)) return; // No need to transmit once it has been transmitted before.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user