From b3379cc108d6eed98cb0010e6f1ddca94aba83a2 Mon Sep 17 00:00:00 2001 From: polwex Date: Tue, 18 Nov 2025 07:50:36 +0700 Subject: implemented proper handling of EOSE events and nostr request batching --- app/lib/nostr/events.hoon | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'app/lib/nostr/events.hoon') diff --git a/app/lib/nostr/events.hoon b/app/lib/nostr/events.hoon index 2a3e818..6f287a7 100644 --- a/app/lib/nostr/events.hoon +++ b/app/lib/nostr/events.hoon @@ -1,6 +1,28 @@ /- sur=nostrill, nsur=nostr, post=trill-post, gate=trill-gate /+ js=json-nostr, sr=sortug, trill=trill-post, nostr-keys |% +++ is-feed |= fs=(list filter:nsur) ^- ? + |- ?~ fs .n + =/ filter i.fs + ?~ kinds.filter .n + ?: (~(has in u.kinds.filter) 0) .n + ?: ?& (~(has in u.kinds.filter) 1) + ?=(%~ ids.filter) + ?=(%~ authors.filter) + ?=(%~ tags.filter) + == .y + $(fs t.fs) + +++ is-posts-no-prof |= fs=(list filter:nsur) ^- ? + =/ has-posts .n + |- ?~ fs has-posts + =/ filter i.fs + ?~ kinds.filter .n + ?: (~(has in u.kinds.filter) 0) .n + =. has-posts + ?: (~(has in u.kinds.filter) 1) .y has-posts + $(fs t.fs) + ++ post-to-event |= [=keys:nsur eny=@ p=post:post] ^- event:nsur =/ cl (latest-post-content:trill contents.p) =/ string (crip (content-list-to-md:trill cl)) -- cgit v1.2.3