diff options
author | polwex <polwex@sortug.com> | 2025-06-27 22:53:52 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-06-27 22:53:52 +0700 |
commit | 328ebe85135912678bdacd3381126ffd66ef2761 (patch) | |
tree | 365962bf45302f2a440f766a4f3c9e0a962dbe47 /desk/sur/trill |
init
Diffstat (limited to 'desk/sur/trill')
-rw-r--r-- | desk/sur/trill/gate.hoon | 26 | ||||
-rw-r--r-- | desk/sur/trill/post.hoon | 115 |
2 files changed, 141 insertions, 0 deletions
diff --git a/desk/sur/trill/gate.hoon b/desk/sur/trill/gate.hoon new file mode 100644 index 0000000..ddc0adb --- /dev/null +++ b/desk/sur/trill/gate.hoon @@ -0,0 +1,26 @@ +|% ++$ gate +$: =lock + begs=(set @p) :: follow requests + post-begs=(set post-beg) :: read requests for specific posts + :: TODO include whole thread? + mute=lock :: mute list to prevent request spamming + backlog=$~(50 @) :: size of backlog sent to followers by default +== ++$ post-beg [=ship id=@da] + ++$ lock +$: rank=[caveats=(set rank:title) locked=_| public=?] + luk=[caveats=(set ship) locked=_| public=?] + ship=[caveats=(set ship) locked=_| public=?] + tags=[caveats=(set @t) locked=_| public=?] + custom=[fn=(unit $-(@p ?)) public=?] +== ++$ change +$% [%set-rank set=(set rank:title) locked=? public=?] + [%set-luk set=(set ship) locked=? public=?] + [%set-ship set=(set ship) locked=? public=?] + [%set-tags set=(set @t) locked=? public=?] + [%set-custom term] :: Handle this and set in hoon +== +-- diff --git a/desk/sur/trill/post.hoon b/desk/sur/trill/post.hoon new file mode 100644 index 0000000..78c5e1a --- /dev/null +++ b/desk/sur/trill/post.hoon @@ -0,0 +1,115 @@ +/- gate=trill-gate +/+ mp=mop-extensions +|% ++$ id @da ++$ pid [=ship =id] +:: anon post type? ++$ tag @t ++$ gfeed ((mop pid post) ggth) +++ ggth |=([[shipa=@p a=time] [shipb=@p b=time]] (gth a b)) +++ gorm ((on pid post) ggth) +++ torm ((on pid thread) ggth) +++ porm ((on pid pid) ggth) +++ gorrm ((mp pid post) ggth) ++$ feed ((mop id post) gth) +++ orm ((on id post) gth) ++$ full-graph ((mop pid full-node) ggth) +++ form ((on pid full-node) ggth) +:: instead of using this I'm just gonna jam old names ++$ perms [read=lock:gate write=lock:gate] ++$ cursor (unit id) ++$ page-req [newer=cursor older=cursor count=@ud] ++$ full-node [p=post children=$~(~ full-graph)] ++$ cpage [p=(list post) top=@ud bot=@ud] ++$ spage [p=(list post) page-req] ++$ page [p=(list full-node) page-req] ++$ pfilter $-(=post ?) ++$ tfilter $-(=thread ?) ++$ bfilter $-([=thread =post] ?) :: search filter ++$ tpage [p=(list thread) page-req] ++$ thread + $: =pid + replies=(list pid) :: key should be the head of this list + title=@t + =path + tags=(set tag) + snip=content-list + == ++$ post + $: =id + title=@t + author=ship + thread=pid :: this is the key of the threads table! + parent=(unit pid) + children=(set pid) + contents=content-map + =perms + =engagement + =signature + tags=(set tag) ::TODO make sure it's not infinite + == +:: ++$ signature [p=@uvH q=ship r=life] ++$ engagement + $: + =reacts quoted=(set signed-pid) + shared=(set signed-pid) + == ++$ signed-pid [=signature =pid] ++$ react @t ++$ reacts (map ship signed-react) ++$ signed-react [p=react q=signature] + + ++$ content-map ((mop time content-list) gth) +++ corm ((on time content-list) gth) ++$ heading $?(%h1 %h2 %h3 %h4 %h5 %h6) ++$ content-list (list block) ++$ paragraph (list inline) +:: man tables are a rabbit hole. we'll get to it +++ table +|^ [%table headers=(list cell) rows=(list row)] ++$ row (list cell) ++$ cell content-list +-- ++$ clist [%list p=(list li) ordered=?] ++$ li content-list ++$ block + $% [%paragraph p=paragraph] + [%blockquote p=paragraph] + :: table + clist + [%heading p=cord q=heading] + [%media =media] + [%codeblock code=cord lang=cord] + [%eval hoon=cord] + [%tasklist p=(list task)] + :: + [%ref app=term =ship =path] + [%json origin=term content=@t] + == ++$ task [p=paragraph q=?] ++$ poll-opt [option=cord votes=@] ++$ media + $% [%images p=(list [url=@t caption=@t])] + [%video p=cord] + [%audio p=cord] + == ++$ inline + $% [%text p=cord] + [%italic p=cord] + [%bold p=cord] + [%strike p=cord] + [%codespan p=cord] + [%link href=cord show=cord] + [%break ~] + :: not strictly markdown + [%ship p=ship] + [%date p=@da] + [%note id=cord text=(list inline)] :: footnotes and so on + [%underline p=cord] + [%sup p=cord] + [%sub p=cord] + [%ruby p=cord q=cord] + == +-- |