diff --git a/bouncer.js b/bouncer.js index 34862a9..ac7fa3f 100644 --- a/bouncer.js +++ b/bouncer.js @@ -132,6 +132,7 @@ module.exports = (ws, req, onClose) => { ws.pause_subs.delete(origID); ws.subalias.set(faked, origID); ws.fakesubalias.set(origID, faked); + if (!filter.since) filter.since = Math.floor(Date.now() / 1000); // Will not impact everything. Only used for handling passing pause_on_limit (or save mode) ws.mergedFilters.set(origID, filter); data[1] = faked; bc(data, ws); @@ -245,7 +246,7 @@ function newConn(addr, client, reconn_t = 0) { if (!client.subalias.has(data[1])) return; data[1] = client.subalias.get(data[1]); const filter = client.mergedFilters.get(data[1]); - if (client.pause_subs.has(data[1]) && (!filter.since || filter.since < data[2].created_at)) return; + if (client.pause_subs.has(data[1]) && (filter.since < data[2].created_at)) return; if (client.rejectKinds && client.rejectKinds.includes(data[2]?.id)) return; diff --git a/config.js.example b/config.js.example index 9b0d7db..4ab7385 100644 --- a/config.js.example +++ b/config.js.example @@ -47,6 +47,7 @@ module.exports = { // Pause an subscription from receiving further events after reached to // Could save client's bandwidth. Disable this if you need to get more events. + // This is also known as save mode. // // You may also need to adjust . pause_on_limit: true,