feed: fix too many subscriptions

fetch profile meta data only for future notes for pubkeys that are
not known of if the event kind is a text note, but not for reactions
or meta data.

this drastically reduces one time subscriptions.
OFF0 2023-07-22 18:48:25 +02:00
parent b67f59ebec
commit 86ac5e47fa
Signed by: offbyn
GPG Key ID: 94A2F643C51F37FA
1 changed files with 6 additions and 0 deletions

View File

@ -59,6 +59,12 @@ export const sub24hFeed = (onEvent: SubCallback) => {
sub({ sub({
cb: (evt, relay) => { cb: (evt, relay) => {
onEvent(evt, relay); onEvent(evt, relay);
if (
evt.kind !== 1
|| pubkeys.has(evt.pubkey)
) {
return;
}
subOnce({ // get profil data subOnce({ // get profil data
relay, relay,
cb: onEvent, cb: onEvent,