summaryrefslogtreecommitdiff
path: root/app/lib/nostr/events.hoon
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/nostr/events.hoon')
-rw-r--r--app/lib/nostr/events.hoon22
1 files changed, 22 insertions, 0 deletions
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))