mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-20 21:31:32 +03:00
77 lines
1.7 KiB
Plaintext
77 lines
1.7 KiB
Plaintext
/- *post, met=metadata-store, graph=graph-store, hark=hark-graph-hook
|
|
|_ i=indexed-post
|
|
++ grow
|
|
|%
|
|
++ noun i
|
|
::
|
|
++ graph-indexed-post
|
|
^- indexed-post
|
|
?+ index.p.i ~|(index+index.p.i !!)
|
|
:: top-level link post; title and url
|
|
::
|
|
[@ ~]
|
|
?> ?=([[%text @] $%([%url @] [%reference *]) ~] contents.p.i)
|
|
i
|
|
::
|
|
:: comment on link post; container structure
|
|
::
|
|
[@ @ ~]
|
|
?> ?=(~ contents.p.i)
|
|
i
|
|
::
|
|
:: comment on link post; comment text
|
|
::
|
|
[@ @ @ ~]
|
|
?> ?=(^ contents.p.i)
|
|
i
|
|
==
|
|
::
|
|
++ graph-permissions-add
|
|
|= vip=vip-metadata:met
|
|
^- permissions:graph
|
|
=/ reader
|
|
?=(%reader-comments vip)
|
|
?+ index.p.i !!
|
|
[@ ~] [%yes %yes %no]
|
|
[@ @ ~] [%yes %yes ?:(reader %yes %no)]
|
|
[@ @ @ ~] [%self %self %self]
|
|
==
|
|
::
|
|
++ graph-permissions-remove
|
|
|= vip=vip-metadata:met
|
|
^- permissions:graph
|
|
=/ reader
|
|
?=(%reader-comments vip)
|
|
?+ index.p.i !!
|
|
[@ ~] [%yes %self %self]
|
|
[@ @ ~] [%yes %self %self]
|
|
[@ @ @ ~] [%yes %self %self]
|
|
==
|
|
::
|
|
++ notification-kind
|
|
^- (unit notif-kind:hark)
|
|
?+ index.p.i ~
|
|
[@ ~] `[%link [0 1] %each %children]
|
|
[@ @ %1 ~] `[%comment [1 2] %count %siblings]
|
|
==
|
|
::
|
|
++ transform-add-nodes
|
|
|= [=index =post =atom was-parent-modified=?]
|
|
^- [^index ^post]
|
|
=- [- post(index -)]
|
|
?+ index ~|(transform+[index post] !!)
|
|
[@ ~] [atom ~]
|
|
[@ @ ~] [i.index atom ~]
|
|
[@ @ @ ~]
|
|
?: was-parent-modified
|
|
[i.index atom i.t.t.index ~]
|
|
index
|
|
==
|
|
--
|
|
++ grab
|
|
|%
|
|
++ noun indexed-post
|
|
--
|
|
++ grad %noun
|
|
--
|