hark-graph-hook: do not autowatch leaf nodes

This commit is contained in:
Liam Fitzgerald 2020-12-07 15:06:19 +10:00
parent e7de3533ee
commit 12bfae630b
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
4 changed files with 16 additions and 11 deletions

View File

@ -18,6 +18,9 @@
watch-on-self=_&
==
::
+$ notif-kind
[name=@t parent-lent=@ud mode=?(%each %count) watch=?]
::
--
::
=| state-0
@ -236,7 +239,7 @@
^- (quip card _state)
=^ child-cards state
(check-node-children node tube)
=+ !< notif-kind=(unit [name=@t parent-lent=@ud mode=?(%each %count)])
=+ !< notif-kind=(unit notif-kind)
(tube !>([0 post.node]))
?~ notif-kind
[child-cards state]
@ -250,7 +253,7 @@
[%graph group rid module.metadata desc parent]
?: =(our.bowl author.post.node)
=^ self-cards state
(self-post node notif-index mode.u.notif-kind)
(self-post node notif-index [mode watch]:u.notif-kind)
:_ state
(weld child-cards self-cards)
:_ state
@ -282,13 +285,14 @@
|= $: =node:graph-store
=index:store
mode=?(%count %each)
watch=?
==
^- (quip card _state)
=| cards=(list card)
=? cards ?=(%count mode)
:_ cards
(poke-hark %read-count index)
?. ?=(%.y watch-on-self)
?. &(watch watch-on-self)
[cards state]
:- cards
state(watching (~(put in watching) [rid index.post.node]))

View File

@ -4,8 +4,9 @@
|%
++ noun i
++ notification-kind
::
?+ index.p.i ~
[@ ~] `[%message 0 %count]
[@ ~] `[%message 0 %count %.n]
==
--
++ grab

View File

@ -5,9 +5,9 @@
++ noun i
++ notification-kind
?+ index.p.i ~
[@ ~] `[%link 0 %each]
[@ @ %1 ~] `[%comment 1 %count]
[@ @ @ ~] `[%edit-comment 1 %count]
[@ ~] `[%link 0 %each %.y]
[@ @ %1 ~] `[%comment 1 %count %.n]
[@ @ @ ~] `[%edit-comment 1 %count %.n]
==
--
++ grab

View File

@ -8,10 +8,10 @@
::
++ notification-kind
?+ index.p.i ~
[@ %1 %1 ~] `[%note 0 %each]
[@ %1 @ ~] `[%edit-note 0 %each]
[@ %2 @ %1 ~] `[%comment 1 %count]
[@ %2 @ @ ~] `[%edit-comment 1 %count]
[@ %1 %1 ~] `[%note 0 %each %.n]
[@ %1 @ ~] `[%edit-note 0 %each %.n]
[@ %2 @ %1 ~] `[%comment 1 %count %.n]
[@ %2 @ @ ~] `[%edit-comment 1 %count %.n]
==
--
++ grab