diff options
author | polwex <polwex@sortug.com> | 2025-08-28 12:59:01 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-08-28 12:59:01 +0700 |
commit | 7c0681a06e0358887d2f64001dc43125554766c9 (patch) | |
tree | cd19f060a5f4147d6ee6928eecfe1abf03bdbb8e /desk/sur/post.hoon |
init
Diffstat (limited to 'desk/sur/post.hoon')
-rw-r--r-- | desk/sur/post.hoon | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/desk/sur/post.hoon b/desk/sur/post.hoon new file mode 100644 index 0000000..f7bdde6 --- /dev/null +++ b/desk/sur/post.hoon @@ -0,0 +1,120 @@ +/- gate +|% ++$ id @da ++$ pid [=ship =id] +:: anon post type? ++$ tag @t ++$ post + $: =id + host=ship + author=ship + thread=id + parent=(unit id) + children=(set id) + contents=content-map + read=lock:gate + write=lock:gate + =engagement + =hash + =signature + tags=(set tag) ::TODO make sure it's not infinite + == ++$ sent-post + $: host=ship + author=ship + thread=(unit id) + parent=(unit id) + contents=content-list + read=lock:gate + write=lock:gate + tags=(set tag) + == ++$ full-node + $: =id + host=ship + author=ship + thread=id + parent=(unit id) + children=internal-graph + contents=content-map + read=lock:gate + write=lock:gate + =engagement + =hash + =signature + tags=(set tag) + == +:: recursive types crash ++$ internal-graph + $~ [%empty ~] + $% [%full p=full-graph] + [%empty ~] + == ++$ full-graph ((mop id full-node) gth) +++ form ((on id full-node) gth) +:: from post:graph-store +:: +sham (half sha-256) hash of +validated-portion ++$ hash @uvH +:: ++$ 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-2) ++$ signed-react [=pid author=ship =react =signature] ++$ signed-react-2 [p=react q=signature] + + ++$ content-map ((mop time content-list) gth) +++ corm ((on time content-list) gth) ++$ content-list contents:contents-1 +++ contents-1 +|% ++$ contents (list block) ++$ block + $% [%paragraph p=(list inline)] + [%blockquote p=(list inline)] + [%table rows=(list (list contents))] + [%heading p=cord q=@] + [%list p=(list inline) ordered=?] + [%media =media] + [%codeblock code=cord lang=cord] + [%eval hoon=cord] + :: + [%ref type=term =ship =path] + :: + [%json origin=term content=@t] + :: TODO get rid of this. should be a ref + [%poll id=@da] + == ++$ poll-opt [option=cord votes=@] ++$ media + $% [%images p=(list cord)] + [%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 + [%underline p=cord] + [%sup p=cord] + [%sub p=cord] + [%ruby p=cord q=cord] + :: custom types + [%ship p=ship] + :: TODO + :: [%date p=@da] + == +-- +-- |