hark-graph-hook: make it compile

This commit is contained in:
Logan Allen 2021-04-13 16:30:35 -05:00
parent fb04a88031
commit 2dd6e9a661

View File

@ -24,7 +24,6 @@
watch-on-self=_& watch-on-self=_&
== ==
:: ::
::
++ scry ++ scry
|* [[our=@p now=@da] =mold p=path] |* [[our=@p now=@da] =mold p=path]
?> ?=(^ p) ?> ?=(^ p)
@ -37,7 +36,6 @@
%^ scry [our now] %^ scry [our now]
tube:clay tube:clay
/cc/[desk]/[mark]/notification-kind /cc/[desk]/[mark]/notification-kind
::
-- --
:: ::
=| state-1 =| state-1
@ -198,8 +196,8 @@
?(%remove-graph %archive-graph) ?(%remove-graph %archive-graph)
(remove-graph resource.q.update) (remove-graph resource.q.update)
:: ::
%remove-nodes %remove-posts
(remove-nodes resource.q.update indices.q.update) (remove-posts resource.q.update indices.q.update)
:: ::
%add-nodes %add-nodes
=* rid resource.q.update =* rid resource.q.update
@ -208,7 +206,7 @@
:: this is awful, but notification kind should always switch :: this is awful, but notification kind should always switch
:: on the index, so hopefully doesn't matter :: on the index, so hopefully doesn't matter
:: TODO: rethink this :: TODO: rethink this
++ remove-nodes ++ remove-posts
|= [rid=resource indices=(set index:graph-store)] |= [rid=resource indices=(set index:graph-store)]
=/ to-remove =/ to-remove
%- ~(gas by *(set [resource index:graph-store])) %- ~(gas by *(set [resource index:graph-store]))
@ -264,7 +262,6 @@
:_ state(watching (~(put in watching) [rid ~])) :_ state(watching (~(put in watching) [rid ~]))
(weld cards (give:ha ~[/updates] %listen [rid ~])) (weld cards (give:ha ~[/updates] %listen [rid ~]))
:: ::
::
++ check-nodes ++ check-nodes
|= $: nodes=(list node:graph-store) |= $: nodes=(list node:graph-store)
rid=resource rid=resource
@ -417,30 +414,33 @@
|= =node:graph-store |= =node:graph-store
^+ update-core ^+ update-core
=. update-core (check-node-children node) =. update-core (check-node-children node)
?: ?=(%| -.post.node)
update-core
=* pos p.post.node
=+ !< notif-kind=(unit notif-kind:hook) =+ !< notif-kind=(unit notif-kind:hook)
(get-conversion !>([0 post.node])) (get-conversion !>([0 pos]))
?~ notif-kind ?~ notif-kind
update-core update-core
=/ desc=@t =/ desc=@t
?: (is-mention contents.post.node) ?: (is-mention contents.pos)
%mention %mention
name.u.notif-kind name.u.notif-kind
=* not-kind u.notif-kind =* not-kind u.notif-kind
=/ parent=index:post =/ parent=index:post
(scag parent.index-len.not-kind index.post.node) (scag parent.index-len.not-kind index.pos)
=/ notif-index=index:store =/ notif-index=index:store
[%graph group rid module desc parent] [%graph group rid module desc parent]
?: =(our.bowl author.post.node) ?: =(our.bowl author.pos)
(self-post node notif-index not-kind) (self-post node notif-index not-kind)
=. update-core =. update-core
(update-unread-count not-kind notif-index [time-sent index]:post.node) (update-unread-count not-kind notif-index [time-sent index]:pos)
=? update-core =? update-core
?| =(desc %mention) ?| =(desc %mention)
(~(has in watching) [rid parent]) (~(has in watching) [rid parent])
== ==
=/ =contents:store =/ =contents:store
[%graph (limo post.node ~)] [%graph (limo pos ~)]
(add-unread notif-index [time-sent.post.node %.n contents]) (add-unread notif-index [time-sent.pos %.n contents])
update-core update-core
:: ::
++ update-unread-count ++ update-unread-count
@ -459,19 +459,19 @@
=notif-kind:hook =notif-kind:hook
== ==
^+ update-core ^+ update-core
?> ?=(%& -.post.node)
=/ =stats-index:store =/ =stats-index:store
(to-stats-index:store index) (to-stats-index:store index)
=. update-core =. update-core
(hark %seen-index time-sent.post.node stats-index) (hark %seen-index time-sent.p.post.node stats-index)
=? update-core ?=(%count mode.notif-kind) =? update-core ?=(%count mode.notif-kind)
(hark %read-count stats-index) (hark %read-count stats-index)
=? update-core watch-on-self =? update-core watch-on-self
(new-watch index.post.node [watch-for index-len]:notif-kind) (new-watch index.p.post.node [watch-for index-len]:notif-kind)
update-core update-core
:: ::
++ add-unread ++ add-unread
|= [=index:store =notification:store] |= [=index:store =notification:store]
(hark %add-note index notification) (hark %add-note index notification)
::
-- --
-- --