2020-10-21 09:02:51 +03:00
|
|
|
:: hark-graph-hook: notifications for graph-store [landscape]
|
|
|
|
::
|
2021-01-28 09:13:57 +03:00
|
|
|
/- post, group-store, metadata=metadata-store, hook=hark-graph-hook, store=hark-store
|
|
|
|
/+ resource, mdl=metadata, default-agent, dbug, graph-store, graph, grouplib=group, store=hark-store
|
2020-10-21 09:02:51 +03:00
|
|
|
::
|
2020-11-24 05:20:44 +03:00
|
|
|
::
|
2020-12-05 07:32:17 +03:00
|
|
|
~% %hark-graph-hook-top ..part ~
|
2020-10-21 09:02:51 +03:00
|
|
|
|%
|
|
|
|
+$ card card:agent:gall
|
|
|
|
+$ versioned-state
|
|
|
|
$% state-0
|
2021-01-14 03:47:11 +03:00
|
|
|
state-1
|
2020-10-21 09:02:51 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
+$ state-0
|
2021-01-14 03:47:11 +03:00
|
|
|
[%0 base-state-0]
|
|
|
|
::
|
|
|
|
+$ state-1
|
|
|
|
[%1 base-state-0]
|
|
|
|
::
|
|
|
|
+$ base-state-0
|
|
|
|
$: watching=(set [resource index:post])
|
2020-10-27 08:05:00 +03:00
|
|
|
mentions=_&
|
|
|
|
watch-on-self=_&
|
2020-10-21 09:02:51 +03:00
|
|
|
==
|
|
|
|
::
|
2020-12-07 08:06:19 +03:00
|
|
|
+$ notif-kind
|
2020-12-16 10:37:10 +03:00
|
|
|
[name=@t parent-lent=@ud mode=?(%each %count %none) watch=?]
|
2020-12-07 08:06:19 +03:00
|
|
|
::
|
2020-12-14 06:14:56 +03:00
|
|
|
++ scry
|
|
|
|
|* [[our=@p now=@da] =mold p=path]
|
|
|
|
?> ?=(^ p)
|
|
|
|
?> ?=(^ t.p)
|
|
|
|
.^(mold i.p (scot %p our) i.t.p (scot %da now) t.t.p)
|
|
|
|
::
|
|
|
|
++ scry-conversion
|
|
|
|
|= [[our=@p now=@da] desk=term =mark]
|
|
|
|
~+
|
|
|
|
%^ scry [our now]
|
|
|
|
tube:clay
|
|
|
|
/cc/[desk]/[mark]/notification-kind
|
|
|
|
::
|
2020-10-21 09:02:51 +03:00
|
|
|
--
|
|
|
|
::
|
2021-01-14 03:47:11 +03:00
|
|
|
=| state-1
|
2020-10-21 09:02:51 +03:00
|
|
|
=* state -
|
|
|
|
::
|
2020-12-14 06:14:56 +03:00
|
|
|
=<
|
2020-10-21 09:02:51 +03:00
|
|
|
%- agent:dbug
|
|
|
|
^- agent:gall
|
|
|
|
~% %hark-graph-hook-agent ..card ~
|
|
|
|
|_ =bowl:gall
|
|
|
|
+* this .
|
|
|
|
ha ~(. +> bowl)
|
|
|
|
def ~(. (default-agent this %|) bowl)
|
2021-01-28 09:13:57 +03:00
|
|
|
met ~(. mdl bowl)
|
2020-12-07 06:55:55 +03:00
|
|
|
grp ~(. grouplib bowl)
|
2020-12-01 08:46:28 +03:00
|
|
|
gra ~(. graph bowl)
|
2020-10-21 09:02:51 +03:00
|
|
|
::
|
|
|
|
++ on-init
|
|
|
|
:_ this
|
|
|
|
~[watch-graph:ha]
|
|
|
|
::
|
|
|
|
++ on-save !>(state)
|
|
|
|
++ on-load
|
2021-01-14 03:47:11 +03:00
|
|
|
|= =vase
|
2020-10-21 09:02:51 +03:00
|
|
|
^- (quip card _this)
|
2021-01-14 03:47:11 +03:00
|
|
|
=+ !<(old=versioned-state vase)
|
|
|
|
=| cards=(list card)
|
|
|
|
|-
|
|
|
|
?: ?=(%0 -.old)
|
|
|
|
%_ $
|
|
|
|
-.old %1
|
|
|
|
::
|
|
|
|
cards
|
|
|
|
:_ cards
|
|
|
|
[%pass / %agent [our dap]:bowl %poke noun+!>(%rewatch-dms)]
|
|
|
|
==
|
|
|
|
:_ this(state old)
|
|
|
|
=. cards (flop cards)
|
2020-12-01 08:46:28 +03:00
|
|
|
%+ welp
|
|
|
|
?: (~(has by wex.bowl) [/graph our.bowl %graph-store])
|
2021-01-14 03:47:11 +03:00
|
|
|
cards
|
|
|
|
[watch-graph:ha cards]
|
2020-12-01 08:46:28 +03:00
|
|
|
%+ turn
|
|
|
|
^- (list mark)
|
|
|
|
:~ %graph-validator-chat
|
|
|
|
%graph-validator-link
|
|
|
|
%graph-validator-publish
|
|
|
|
==
|
|
|
|
|= =mark
|
|
|
|
^- card
|
|
|
|
=/ =wire /validator/[mark]
|
|
|
|
=/ =rave:clay [%sing %c [%da now.bowl] /[mark]/notification-kind]
|
|
|
|
[%pass wire %arvo %c %warp our.bowl [%home `rave]]
|
2020-10-21 09:02:51 +03:00
|
|
|
::
|
2020-11-10 22:21:51 +03:00
|
|
|
++ on-watch
|
2020-10-27 08:05:00 +03:00
|
|
|
|= =path
|
|
|
|
^- (quip card _this)
|
|
|
|
=^ cards state
|
2020-11-03 03:36:00 +03:00
|
|
|
?+ path (on-watch:def path)
|
|
|
|
::
|
2020-11-10 22:21:51 +03:00
|
|
|
[%updates ~]
|
2020-11-03 03:36:00 +03:00
|
|
|
:_ state
|
|
|
|
%+ give:ha ~
|
|
|
|
:* %initial
|
|
|
|
watching
|
|
|
|
mentions
|
|
|
|
watch-on-self
|
|
|
|
==
|
2020-10-27 08:05:00 +03:00
|
|
|
==
|
|
|
|
[cards this]
|
2020-10-21 09:02:51 +03:00
|
|
|
::
|
|
|
|
++ on-poke
|
|
|
|
~/ %hark-graph-hook-poke
|
|
|
|
|= [=mark =vase]
|
|
|
|
^- (quip card _this)
|
|
|
|
|^
|
|
|
|
?> (team:title our.bowl src.bowl)
|
|
|
|
=^ cards state
|
|
|
|
?+ mark (on-poke:def mark vase)
|
|
|
|
%hark-graph-hook-action
|
|
|
|
(hark-graph-hook-action !<(action:hook vase))
|
2021-01-14 03:47:11 +03:00
|
|
|
%noun
|
|
|
|
(poke-noun !<(* vase))
|
2020-10-21 09:02:51 +03:00
|
|
|
==
|
|
|
|
[cards this]
|
|
|
|
::
|
2021-01-14 03:47:11 +03:00
|
|
|
++ poke-noun
|
|
|
|
|= non=*
|
|
|
|
?> ?=(%rewatch-dms non)
|
|
|
|
=/ graphs=(list resource)
|
|
|
|
~(tap in get-keys:gra)
|
|
|
|
:- ~
|
|
|
|
%_ state
|
|
|
|
watching
|
|
|
|
%- ~(gas in watching)
|
|
|
|
(murn graphs |=(rid=resource ?:((should-watch:ha rid) `[rid ~] ~)))
|
|
|
|
==
|
|
|
|
::
|
2020-10-21 09:02:51 +03:00
|
|
|
++ hark-graph-hook-action
|
|
|
|
|= =action:hook
|
|
|
|
^- (quip card _state)
|
|
|
|
|^
|
2020-11-10 06:32:48 +03:00
|
|
|
:- (give:ha ~[/updates] action)
|
2020-10-21 09:02:51 +03:00
|
|
|
?- -.action
|
|
|
|
%listen (listen +.action)
|
|
|
|
%ignore (ignore +.action)
|
2020-10-27 08:05:00 +03:00
|
|
|
%set-mentions (set-mentions +.action)
|
|
|
|
%set-watch-on-self (set-watch-on-self +.action)
|
2020-10-21 09:02:51 +03:00
|
|
|
==
|
|
|
|
++ listen
|
2020-11-10 04:41:19 +03:00
|
|
|
|= [graph=resource =index:post]
|
2020-11-11 03:36:32 +03:00
|
|
|
^+ state
|
2020-11-10 04:41:19 +03:00
|
|
|
state(watching (~(put in watching) [graph index]))
|
2020-10-21 09:02:51 +03:00
|
|
|
::
|
|
|
|
++ ignore
|
2020-11-10 04:41:19 +03:00
|
|
|
|= [graph=resource =index:post]
|
2020-11-11 03:36:32 +03:00
|
|
|
^+ state
|
2020-11-10 04:41:19 +03:00
|
|
|
state(watching (~(del in watching) [graph index]))
|
2020-10-21 09:02:51 +03:00
|
|
|
::
|
2020-10-27 08:05:00 +03:00
|
|
|
++ set-mentions
|
|
|
|
|= ment=?
|
2020-11-10 06:32:48 +03:00
|
|
|
^+ state
|
2020-10-27 08:05:00 +03:00
|
|
|
state(mentions ment)
|
|
|
|
::
|
|
|
|
++ set-watch-on-self
|
|
|
|
|= self=?
|
2020-11-10 06:32:48 +03:00
|
|
|
^+ state
|
2020-10-27 08:05:00 +03:00
|
|
|
state(watch-on-self self)
|
2020-10-21 09:02:51 +03:00
|
|
|
--
|
|
|
|
--
|
|
|
|
::
|
|
|
|
++ on-agent
|
|
|
|
~/ %hark-graph-hook-agent
|
|
|
|
|= [=wire =sign:agent:gall]
|
|
|
|
^- (quip card _this)
|
|
|
|
|^
|
|
|
|
?+ -.sign (on-agent:def wire sign)
|
|
|
|
%kick
|
|
|
|
:_ this
|
|
|
|
?. ?=([%graph ~] wire)
|
|
|
|
~
|
|
|
|
~[watch-graph:ha]
|
|
|
|
::
|
|
|
|
%fact
|
|
|
|
?. ?=(%graph-update p.cage.sign)
|
|
|
|
(on-agent:def wire sign)
|
|
|
|
=^ cards state
|
|
|
|
(graph-update !<(update:graph-store q.cage.sign))
|
|
|
|
[cards this]
|
|
|
|
==
|
2020-12-17 09:10:26 +03:00
|
|
|
::
|
|
|
|
++ graph-update
|
|
|
|
|= =update:graph-store
|
|
|
|
^- (quip card _state)
|
|
|
|
?+ -.q.update `state
|
|
|
|
%add-graph (add-graph resource.q.update)
|
|
|
|
::
|
|
|
|
?(%remove-graph %archive-graph)
|
|
|
|
(remove-graph resource.q.update)
|
2021-01-11 04:55:33 +03:00
|
|
|
::
|
|
|
|
%remove-nodes
|
|
|
|
(remove-nodes resource.q.update indices.q.update)
|
2020-12-17 09:10:26 +03:00
|
|
|
::
|
|
|
|
%add-nodes
|
|
|
|
=* rid resource.q.update
|
|
|
|
(check-nodes ~(val by nodes.q.update) rid)
|
|
|
|
==
|
2021-01-11 04:55:33 +03:00
|
|
|
:: this is awful, but notification kind should always switch
|
|
|
|
:: on the index, so hopefully doesn't matter
|
|
|
|
:: TODO: rethink this
|
|
|
|
++ remove-nodes
|
|
|
|
|= [rid=resource indices=(set index:graph-store)]
|
|
|
|
=/ to-remove
|
|
|
|
%- ~(gas by *(set [resource index:graph-store]))
|
|
|
|
(turn ~(tap in indices) (lead rid))
|
|
|
|
:_ state(watching (~(dif in watching) to-remove))
|
|
|
|
=/ =tube:clay
|
|
|
|
(get-conversion:ha rid)
|
|
|
|
%+ roll
|
|
|
|
~(tap in indices)
|
|
|
|
|= [=index:graph-store out=(list card)]
|
|
|
|
=| =indexed-post:graph-store
|
|
|
|
=. index.p.indexed-post index
|
|
|
|
=+ !<(u-notif-kind=(unit notif-kind) (tube !>(indexed-post)))
|
|
|
|
?~ u-notif-kind out
|
|
|
|
=* notif-kind u.u-notif-kind
|
|
|
|
=/ =stats-index:store
|
|
|
|
[%graph rid (scag parent-lent.notif-kind index)]
|
|
|
|
?. ?=(%each mode.notif-kind) out
|
2021-01-12 01:15:14 +03:00
|
|
|
:_ out
|
|
|
|
(poke-hark %read-each stats-index index)
|
2021-01-11 04:55:33 +03:00
|
|
|
::
|
|
|
|
++ poke-hark
|
|
|
|
|= =action:store
|
|
|
|
^- card
|
|
|
|
[%pass / %agent [our.bowl %hark-store] %poke hark-action+!>(action)]
|
2020-12-17 09:10:26 +03:00
|
|
|
::
|
|
|
|
++ remove-graph
|
|
|
|
|= rid=resource
|
|
|
|
=/ unwatched
|
2021-01-11 07:16:32 +03:00
|
|
|
%- ~(gas in *(set [resource index:graph-store]))
|
2020-12-17 09:10:26 +03:00
|
|
|
%+ skim ~(tap in watching)
|
|
|
|
|= [r=resource idx=index:graph-store]
|
|
|
|
=(r rid)
|
|
|
|
:_ state(watching (~(dif in watching) unwatched))
|
|
|
|
^- (list card)
|
|
|
|
:- (poke-hark:ha %remove-graph rid)
|
|
|
|
%- zing
|
|
|
|
%+ turn ~(tap in unwatched)
|
|
|
|
|= [r=resource =index:graph-store]
|
|
|
|
(give:ha ~[/updates] %ignore r index)
|
|
|
|
::
|
2020-11-10 04:41:19 +03:00
|
|
|
++ add-graph
|
2020-12-17 04:59:35 +03:00
|
|
|
|= rid=resource
|
2020-11-10 04:41:19 +03:00
|
|
|
^- (quip card _state)
|
2020-12-17 04:59:35 +03:00
|
|
|
=/ graph=graph:graph-store :: graph in subscription is bunted
|
|
|
|
(get-graph-mop:gra rid)
|
|
|
|
=/ node=(unit node:graph-store)
|
|
|
|
(bind (peek:orm:graph-store graph) |=([@ =node:graph-store] node))
|
|
|
|
=^ cards state
|
|
|
|
(check-nodes (drop node) rid)
|
2021-01-14 03:47:11 +03:00
|
|
|
?. (should-watch:ha rid)
|
|
|
|
[cards state]
|
2020-12-17 04:59:35 +03:00
|
|
|
:_ state(watching (~(put in watching) [rid ~]))
|
|
|
|
(weld cards (give:ha ~[/updates] %listen [rid ~]))
|
2020-10-21 09:02:51 +03:00
|
|
|
::
|
2020-12-01 08:46:28 +03:00
|
|
|
::
|
|
|
|
++ check-nodes
|
2020-12-14 06:14:56 +03:00
|
|
|
|= $: nodes=(list node:graph-store)
|
2020-12-01 08:46:28 +03:00
|
|
|
rid=resource
|
|
|
|
==
|
2020-12-15 08:38:56 +03:00
|
|
|
=/ group=(unit resource)
|
2021-01-13 07:05:22 +03:00
|
|
|
(peek-group:met %graph rid)
|
2020-12-16 07:22:23 +03:00
|
|
|
?~ group
|
2020-12-17 09:10:26 +03:00
|
|
|
~& no-group+rid
|
2020-12-16 07:22:23 +03:00
|
|
|
`state
|
2021-01-28 09:13:57 +03:00
|
|
|
=/ metadatum=(unit metadatum:metadata)
|
|
|
|
(peek-metadatum:met %graph rid)
|
|
|
|
?~ metadatum `state
|
|
|
|
abet:check:(abed:handle-update:ha rid nodes u.group module.u.metadatum)
|
2020-10-21 09:02:51 +03:00
|
|
|
--
|
|
|
|
::
|
|
|
|
++ on-peek on-peek:def
|
|
|
|
::
|
|
|
|
++ on-leave on-leave:def
|
2020-12-01 08:46:28 +03:00
|
|
|
++ on-arvo
|
|
|
|
|= [=wire =sign-arvo]
|
|
|
|
^- (quip card _this)
|
|
|
|
?+ wire (on-arvo:def wire sign-arvo)
|
|
|
|
::
|
|
|
|
[%validator @ ~]
|
|
|
|
:_ this
|
|
|
|
=* validator i.t.wire
|
|
|
|
=/ =rave:clay [%next %c [%da now.bowl] /[validator]/notification-kind]
|
|
|
|
[%pass wire %arvo %c %warp our.bowl [%home `rave]]~
|
|
|
|
==
|
2020-10-21 09:02:51 +03:00
|
|
|
++ on-fail on-fail:def
|
|
|
|
--
|
2020-12-14 06:14:56 +03:00
|
|
|
::
|
|
|
|
|_ =bowl:gall
|
2021-01-28 09:13:57 +03:00
|
|
|
+* met ~(. mdl bowl)
|
2021-01-14 03:47:11 +03:00
|
|
|
grp ~(. grouplib bowl)
|
|
|
|
gra ~(. graph bowl)
|
2020-12-14 06:14:56 +03:00
|
|
|
::
|
2021-01-11 04:55:33 +03:00
|
|
|
++ get-conversion
|
|
|
|
|= rid=resource
|
|
|
|
^- tube:clay
|
|
|
|
=+ %^ scry [our now]:bowl
|
|
|
|
,mark=(unit mark)
|
|
|
|
/gx/graph-store/graph-mark/(scot %p entity.rid)/[name.rid]/noun
|
|
|
|
?~ mark
|
|
|
|
|=(v=vase !>(~))
|
|
|
|
(scry-conversion [our now]:bowl q.byk.bowl u.mark)
|
2020-12-14 06:14:56 +03:00
|
|
|
::
|
|
|
|
++ give
|
|
|
|
|= [paths=(list path) =update:hook]
|
|
|
|
^- (list card)
|
|
|
|
[%give %fact paths hark-graph-hook-update+!>(update)]~
|
|
|
|
::
|
|
|
|
++ watch-graph
|
|
|
|
^- card
|
|
|
|
[%pass /graph %agent [our.bowl %graph-store] %watch /updates]
|
|
|
|
::
|
|
|
|
++ poke-hark
|
|
|
|
|= =action:store
|
|
|
|
^- card
|
|
|
|
=- [%pass / %agent [our.bowl %hark-store] %poke -]
|
|
|
|
hark-action+!>(action)
|
|
|
|
::
|
|
|
|
++ is-mention
|
|
|
|
|= contents=(list content:post)
|
|
|
|
^- ?
|
|
|
|
?. mentions %.n
|
|
|
|
?~ contents %.n
|
|
|
|
?. ?=(%mention -.i.contents)
|
|
|
|
$(contents t.contents)
|
|
|
|
?: =(our.bowl ship.i.contents)
|
|
|
|
%.y
|
|
|
|
$(contents t.contents)
|
|
|
|
::
|
2021-01-14 03:47:11 +03:00
|
|
|
++ should-watch
|
|
|
|
|= rid=resource
|
|
|
|
^- ?
|
|
|
|
=/ group-rid=(unit resource)
|
2021-01-15 07:48:04 +03:00
|
|
|
(peek-group:met %graph rid)
|
2021-01-14 03:47:11 +03:00
|
|
|
?~ group-rid %.n
|
|
|
|
?| !(is-managed:grp u.group-rid)
|
|
|
|
&(watch-on-self =(our.bowl entity.rid))
|
|
|
|
==
|
|
|
|
::
|
2020-12-14 06:14:56 +03:00
|
|
|
++ handle-update
|
|
|
|
|_ $: rid=resource :: input
|
|
|
|
updates=(list node:graph-store)
|
|
|
|
group=resource
|
|
|
|
module=term
|
|
|
|
hark-pokes=(list action:store) :: output
|
|
|
|
new-watches=(list index:graph-store)
|
|
|
|
==
|
|
|
|
++ update-core .
|
|
|
|
::
|
|
|
|
++ abed
|
|
|
|
|= [r=resource upds=(list node:graph-store) grp=resource mod=term]
|
2020-12-15 08:38:56 +03:00
|
|
|
update-core(rid r, updates upds, group grp, module mod)
|
2020-12-14 06:14:56 +03:00
|
|
|
::
|
|
|
|
++ get-conversion
|
2021-01-11 04:55:33 +03:00
|
|
|
(^get-conversion rid)
|
2020-12-14 06:14:56 +03:00
|
|
|
::
|
|
|
|
++ abet
|
|
|
|
^- (quip card _state)
|
|
|
|
:_ state(watching (~(uni in watching) (silt (turn new-watches (lead rid)))))
|
|
|
|
^- (list card)
|
|
|
|
%+ welp (turn (flop hark-pokes) poke-hark)
|
|
|
|
%- zing
|
|
|
|
%+ turn (flop new-watches)
|
|
|
|
|=(=index:graph-store (give ~[/updates] [%listen rid index]))
|
|
|
|
::
|
|
|
|
++ hark
|
|
|
|
|= =action:store
|
|
|
|
^+ update-core
|
|
|
|
update-core(hark-pokes [action hark-pokes])
|
|
|
|
::
|
|
|
|
++ new-watch
|
|
|
|
|= =index:graph-store
|
|
|
|
update-core(new-watches [index new-watches])
|
|
|
|
::
|
|
|
|
++ check
|
|
|
|
|- ^+ update-core
|
|
|
|
?~ updates
|
|
|
|
update-core
|
|
|
|
=/ core=_update-core
|
|
|
|
(check-node i.updates)
|
|
|
|
=. updates.core t.updates
|
|
|
|
$(update-core core)
|
|
|
|
::
|
|
|
|
++ check-node-children
|
|
|
|
|= =node:graph-store
|
|
|
|
^+ update-core
|
|
|
|
?: ?=(%empty -.children.node)
|
|
|
|
update-core
|
|
|
|
=/ children=(list [=atom =node:graph-store])
|
|
|
|
(tap:orm:graph-store p.children.node)
|
|
|
|
|- ^+ update-core
|
|
|
|
?~ children
|
|
|
|
update-core
|
|
|
|
=. update-core (check-node node.i.children)
|
|
|
|
$(children t.children)
|
|
|
|
::
|
|
|
|
++ check-node
|
|
|
|
|= =node:graph-store
|
|
|
|
^+ update-core
|
|
|
|
=. update-core (check-node-children node)
|
|
|
|
=+ !< notif-kind=(unit notif-kind)
|
|
|
|
(get-conversion !>([0 post.node]))
|
|
|
|
?~ notif-kind
|
|
|
|
update-core
|
|
|
|
=/ desc=@t
|
|
|
|
?: (is-mention contents.post.node)
|
|
|
|
%mention
|
|
|
|
name.u.notif-kind
|
|
|
|
=* not-kind u.notif-kind
|
|
|
|
=/ parent=index:post
|
|
|
|
(scag parent-lent.not-kind index.post.node)
|
|
|
|
=/ notif-index=index:store
|
|
|
|
[%graph group rid module desc parent]
|
2020-12-14 06:33:31 +03:00
|
|
|
?: =(our.bowl author.post.node)
|
2020-12-14 06:14:56 +03:00
|
|
|
(self-post node notif-index [mode watch]:not-kind)
|
|
|
|
=. update-core
|
2020-12-16 07:22:23 +03:00
|
|
|
(update-unread-count not-kind notif-index [time-sent index]:post.node)
|
2020-12-14 06:14:56 +03:00
|
|
|
=? update-core
|
|
|
|
?| =(desc %mention)
|
|
|
|
(~(has in watching) [rid parent])
|
2020-12-14 06:33:31 +03:00
|
|
|
==
|
2020-12-14 06:14:56 +03:00
|
|
|
=/ =contents:store
|
|
|
|
[%graph (limo post.node ~)]
|
|
|
|
(add-unread notif-index [time-sent.post.node %.n contents])
|
|
|
|
update-core
|
|
|
|
::
|
|
|
|
++ update-unread-count
|
2020-12-16 07:22:23 +03:00
|
|
|
|= [=notif-kind =index:store time=@da ref=index:graph-store]
|
|
|
|
=/ =stats-index:store
|
|
|
|
(to-stats-index:store index)
|
|
|
|
?- mode.notif-kind
|
|
|
|
%count (hark %unread-count stats-index time)
|
|
|
|
%each (hark %unread-each stats-index ref time)
|
2020-12-14 06:14:56 +03:00
|
|
|
%none update-core
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ self-post
|
|
|
|
|= $: =node:graph-store
|
|
|
|
=index:store
|
2020-12-16 10:37:10 +03:00
|
|
|
mode=?(%count %each %none)
|
2020-12-14 06:14:56 +03:00
|
|
|
watch=?
|
|
|
|
==
|
|
|
|
^+ update-core
|
2020-12-16 10:37:10 +03:00
|
|
|
?: ?=(%none mode) update-core
|
2020-12-16 07:22:23 +03:00
|
|
|
=/ =stats-index:store
|
|
|
|
(to-stats-index:store index)
|
2020-12-14 06:33:31 +03:00
|
|
|
=. update-core
|
2020-12-16 07:22:23 +03:00
|
|
|
(hark %seen-index time-sent.post.node stats-index)
|
2020-12-14 06:14:56 +03:00
|
|
|
=? update-core ?=(%count mode)
|
2020-12-16 07:22:23 +03:00
|
|
|
(hark %read-count stats-index)
|
2020-12-14 06:14:56 +03:00
|
|
|
=? update-core &(watch watch-on-self)
|
|
|
|
(new-watch index.post.node)
|
|
|
|
update-core
|
|
|
|
::
|
|
|
|
++ add-unread
|
|
|
|
|= [=index:store =notification:store]
|
|
|
|
(hark %add-note index notification)
|
|
|
|
::
|
|
|
|
--
|
|
|
|
--
|