summaryrefslogtreecommitdiff
path: root/app/lib/mutations/nostr.hoon
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-11-19 05:47:15 +0700
committerpolwex <polwex@sortug.com>2025-11-19 05:47:15 +0700
commite6e657be3a3b1dae426b46f3bc16f9a5cf4861c2 (patch)
tree8c04343c4b13861f2124b34f16652418e671e423 /app/lib/mutations/nostr.hoon
parent4bad4b5705144b6a537053c68c3c2c3f5984de85 (diff)
Improvements to handling nostr post on backend
Diffstat (limited to 'app/lib/mutations/nostr.hoon')
-rw-r--r--app/lib/mutations/nostr.hoon16
1 files changed, 11 insertions, 5 deletions
diff --git a/app/lib/mutations/nostr.hoon b/app/lib/mutations/nostr.hoon
index 66fdc35..55cffe7 100644
--- a/app/lib/mutations/nostr.hoon
+++ b/app/lib/mutations/nostr.hoon
@@ -126,7 +126,7 @@
:: increment event count in relay state
~& >> parsing-nostr-event=kind.event
~& >> sub-id=sub-id
- ~& > relay-subs=~(key by reqs.relay)
+ :: ~& > relay-subs=~(key by reqs.relay)
=/ req (~(get by reqs.relay) sub-id)
?~ req ~& >>> "sub id not found in relay state" `state
@@ -244,20 +244,22 @@
:: if there's a queue we setup the next subscription
=^ cards relay
?: (is-feed:evlib filters.u.creq)
+ ~& >> "eose on global feed request"
=/ c (update-ui:cardslib [%nostr %feed nostr-feed.state])
=^ mc relay get-profiles:nclient
[[c mc] relay]
::
=/ users=(set @ux) (user-req:evlib filters.u.creq)
?: (gth ~(wyt in users) 0)
+ ~& >>> "eose on user feed request"
=/ poasts (tap:norm:sur nostr-feed.state)
=/ subset %+ skim poasts |= [* ev=event:nsur] (~(has in users) pubkey.ev)
=/ f (gas:norm:sur *nostr-feed:sur subset)
=/ c (update-ui:cardslib [%nostr %user f])
- =^ mc relay get-profiles:nclient
- [[c mc] relay]
+ [:~(c) relay]
=/ thread-id (thread-req:evlib filters.u.creq)
?^ thread-id
+ ~& >>> "eose on thread request"
=/ poasts (tap:norm:sur nostr-feed.state)
=/ subset %+ skim poasts |= [* ev=event:nsur]
?| .=(u.thread-id id.ev)
@@ -266,8 +268,11 @@
==
=/ f (gas:norm:sur *nostr-feed:sur subset)
=/ c (update-ui:cardslib [%nostr %thread f])
- =^ mc relay get-profiles:nclient
- [[c mc] relay]
+ [:~(c) relay]
+ ::
+ ?: (profs-req:evlib filters.u.creq)
+ =/ c (update-ui:cardslib [%prof profiles.state])
+ [:~(c) relay]
::
[~ relay]
::
@@ -320,6 +325,7 @@
%sync get-posts:nclient
%user (get-user-feed:nclient +.rh)
%thread (get-thread:nclient +.rh)
+ %prof get-profiles:nclient
::
==
=. relays.state (~(put by relays.state) -.u.rl relay)