mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-02 20:15:27 +03:00
Merge branch 'lf/hark-redux' into lf/hark-graph-indices
This commit is contained in:
commit
fdcb2c32db
@ -21,7 +21,18 @@
|
||||
=| state-0
|
||||
=* state -
|
||||
::
|
||||
=<
|
||||
=>
|
||||
|_ =bowl:gall
|
||||
::
|
||||
++ give
|
||||
|= [paths=(list path) =update:hook]
|
||||
^- (list card)
|
||||
[%give %fact paths hark-chat-hook-update+!>(update)]~
|
||||
::
|
||||
++ watch-chat
|
||||
^- card
|
||||
[%pass /chat %agent [our.bowl %chat-store] %watch /updates]
|
||||
--
|
||||
%- agent:dbug
|
||||
^- agent:gall
|
||||
~% %hark-chat-hook-agent ..card ~
|
||||
@ -73,6 +84,7 @@
|
||||
|= =action:hook
|
||||
^- (quip card _state)
|
||||
|^
|
||||
:- (give:ha ~[/updates] action)
|
||||
?- -.action
|
||||
%listen (listen +.action)
|
||||
%ignore (ignore +.action)
|
||||
@ -80,20 +92,17 @@
|
||||
==
|
||||
++ listen
|
||||
|= chat=path
|
||||
^- (quip card _state)
|
||||
:- (give:ha ~[/updates] [%listen chat])
|
||||
^+ state
|
||||
state(watching (~(put in watching) chat))
|
||||
::
|
||||
++ ignore
|
||||
|= chat=path
|
||||
^- (quip card _state)
|
||||
:- (give:ha ~[/updates] [%ignore chat])
|
||||
^+ state
|
||||
state(watching (~(del in watching) chat))
|
||||
::
|
||||
++ set-mentions
|
||||
|= ment=?
|
||||
^- (quip card _state)
|
||||
:- (give:ha ~[/updates] [%set-mentions ment])
|
||||
^+ state
|
||||
state(mentions ment)
|
||||
--
|
||||
--
|
||||
@ -130,7 +139,7 @@
|
||||
(turn envelopes.update (cury process-envelope path.update))
|
||||
==
|
||||
++ is-mention
|
||||
|= [=path =envelope:chat-store]
|
||||
|= =envelope:chat-store
|
||||
?. ?=(%text -.letter.envelope) %.n
|
||||
?& mentions
|
||||
?= ^
|
||||
@ -147,7 +156,7 @@
|
||||
|= [=path =envelope:chat-store]
|
||||
^- (list card)
|
||||
=/ mention=?
|
||||
(is-mention path envelope)
|
||||
(is-mention envelope)
|
||||
?. ?|(mention (is-notification path envelope))
|
||||
~
|
||||
=/ =index:store
|
||||
@ -159,9 +168,8 @@
|
||||
++ poke-store
|
||||
|= =action:store
|
||||
^- card
|
||||
=/ =cage
|
||||
hark-action+!>(action)
|
||||
[%pass /store %agent [our.bowl %hark-store] %poke cage]
|
||||
=- [%pass /store %agent [our.bowl %hark-store] %poke -]
|
||||
hark-action+!>(action)
|
||||
--
|
||||
::
|
||||
++ on-peek on-peek:def
|
||||
@ -170,15 +178,3 @@
|
||||
++ on-arvo on-arvo:def
|
||||
++ on-fail on-fail:def
|
||||
--
|
||||
|_ =bowl:gall
|
||||
::
|
||||
::
|
||||
++ give
|
||||
|= [paths=(list path) =update:hook]
|
||||
^- (list card)
|
||||
[%give %fact paths hark-chat-hook-update+!>(update)]~
|
||||
::
|
||||
++ watch-chat
|
||||
^- card
|
||||
[%pass /chat %agent [our.bowl %chat-store] %watch /updates]
|
||||
--
|
||||
|
@ -22,7 +22,24 @@
|
||||
=| state-0
|
||||
=* state -
|
||||
::
|
||||
=<
|
||||
=>
|
||||
|_ =bowl:gall
|
||||
::
|
||||
++ scry
|
||||
|* [=mold p=path]
|
||||
?> ?=(^ p)
|
||||
?> ?=(^ t.p)
|
||||
.^(mold i.p (scot %p our.bowl) i.t.p (scot %da now.bowl) t.t.p)
|
||||
::
|
||||
++ 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]
|
||||
--
|
||||
%- agent:dbug
|
||||
^- agent:gall
|
||||
~% %hark-graph-hook-agent ..card ~
|
||||
@ -42,13 +59,13 @@
|
||||
^- (quip card _this)
|
||||
`this(state !<(state-0 old))
|
||||
::
|
||||
++ on-watch
|
||||
++ on-watch
|
||||
|= =path
|
||||
^- (quip card _this)
|
||||
=^ cards state
|
||||
?+ path (on-watch:def path)
|
||||
::
|
||||
[%updates ~]
|
||||
[%updates ~]
|
||||
:_ state
|
||||
%+ give:ha ~
|
||||
:* %initial
|
||||
@ -76,6 +93,7 @@
|
||||
|= =action:hook
|
||||
^- (quip card _state)
|
||||
|^
|
||||
:- (give:ha ~[/updates] action)
|
||||
?- -.action
|
||||
%listen (listen +.action)
|
||||
%ignore (ignore +.action)
|
||||
@ -96,14 +114,12 @@
|
||||
::
|
||||
++ set-mentions
|
||||
|= ment=?
|
||||
^- (quip card _state)
|
||||
:- (give:ha ~[/updates] %set-mentions ment)
|
||||
^+ state
|
||||
state(mentions ment)
|
||||
::
|
||||
++ set-watch-on-self
|
||||
|= self=?
|
||||
^- (quip card _state)
|
||||
:- (give:ha ~[/updates] %set-watch-on-self self)
|
||||
^+ state
|
||||
state(watch-on-self self)
|
||||
--
|
||||
--
|
||||
@ -147,7 +163,7 @@
|
||||
(need (peek-metadata:met %graph group resource.q.update))
|
||||
=* rid resource.q.update
|
||||
=+ %+ scry:ha
|
||||
,mark=(unit mark)
|
||||
,mark=(unit mark)
|
||||
/gx/graph-store/graph-mark/(scot %p entity.rid)/[name.rid]/noun
|
||||
=+ %+ scry:ha
|
||||
,=tube:clay
|
||||
@ -156,7 +172,7 @@
|
||||
~(tap by nodes.q.update)
|
||||
=| cards=(list card)
|
||||
|^
|
||||
?~ nodes
|
||||
?~ nodes
|
||||
[cards state]
|
||||
=* index p.i.nodes
|
||||
=* node q.i.nodes
|
||||
@ -181,7 +197,7 @@
|
||||
=^ new-cards state
|
||||
(check-node node.i.children tube)
|
||||
%_ $
|
||||
cards (weld cards new-cards)
|
||||
cards (weld cards new-cards)
|
||||
children t.children
|
||||
==
|
||||
::
|
||||
@ -201,7 +217,7 @@
|
||||
[child-cards state]
|
||||
=/ desc=@t
|
||||
?: (is-mention contents.post.node)
|
||||
%mention
|
||||
%mention
|
||||
name.u.notif-kind
|
||||
=/ parent=index:post
|
||||
(scag parent-lent.u.notif-kind index.post.node)
|
||||
@ -238,7 +254,7 @@
|
||||
::
|
||||
++ add-unread
|
||||
|= [=index:store =notification:store]
|
||||
^- card
|
||||
^- card
|
||||
=- [%pass / %agent [our.bowl %hark-store] %poke -]
|
||||
hark-action+!>([%add index notification])
|
||||
::
|
||||
@ -251,20 +267,4 @@
|
||||
++ on-arvo on-arvo:def
|
||||
++ on-fail on-fail:def
|
||||
--
|
||||
|_ =bowl:gall
|
||||
::
|
||||
++ scry
|
||||
|* [=mold p=path]
|
||||
?> ?=(^ p)
|
||||
?> ?=(^ t.p)
|
||||
.^(mold i.p (scot %p our.bowl) i.t.p (scot %da now.bowl) t.t.p)
|
||||
::
|
||||
++ 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]
|
||||
--
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
$: unread-count=@ud
|
||||
~
|
||||
==
|
||||
|
||||
::
|
||||
++ orm ((ordered-map @da timebox:store) lth)
|
||||
--
|
||||
@ -67,6 +66,7 @@
|
||||
:_ this
|
||||
[%give %fact ~ hark-update+!>(initial-updates)]~
|
||||
==
|
||||
::
|
||||
++ initial-updates
|
||||
^- update:store
|
||||
:- %more
|
||||
@ -113,8 +113,8 @@
|
||||
^- update:store
|
||||
:^ %timebox time %.n
|
||||
~(tap by timebox)
|
||||
::
|
||||
==
|
||||
::
|
||||
++ on-poke
|
||||
~/ %hark-store-poke
|
||||
|= [=mark =vase]
|
||||
@ -211,7 +211,6 @@
|
||||
^- (quip card _state)
|
||||
:_ state(dnd d)
|
||||
(give:ha [/updates]~ %set-dnd d)
|
||||
::
|
||||
--
|
||||
--
|
||||
::
|
||||
|
@ -2,7 +2,7 @@
|
||||
/+ drum=hood-drum, helm=hood-helm, kiln=hood-kiln
|
||||
|%
|
||||
+$ state
|
||||
$: %10
|
||||
$: %11
|
||||
drum=state:drum
|
||||
helm=state:helm
|
||||
kiln=state:kiln
|
||||
@ -13,6 +13,7 @@
|
||||
[%7 drum=state:drum helm=state:helm kiln=state:kiln]
|
||||
[%8 drum=state:drum helm=state:helm kiln=state:kiln]
|
||||
[%9 drum=state:drum helm=state:helm kiln=state:kiln]
|
||||
[%10 drum=state:drum helm=state:helm kiln=state:kiln]
|
||||
==
|
||||
+$ any-state-tuple
|
||||
$: drum=any-state:drum
|
||||
|
@ -3,11 +3,9 @@
|
||||
=< [. sur]
|
||||
=, sur
|
||||
|%
|
||||
::
|
||||
++ dejs
|
||||
=, dejs:format
|
||||
|%
|
||||
::
|
||||
++ action
|
||||
%- of
|
||||
:~ listen+pa
|
||||
@ -19,7 +17,6 @@
|
||||
++ enjs
|
||||
=, enjs:format
|
||||
|%
|
||||
::
|
||||
++ update
|
||||
|= upd=^update
|
||||
%+ frond -.upd
|
||||
|
@ -4,7 +4,6 @@
|
||||
=< [. sur]
|
||||
=, sur
|
||||
|%
|
||||
::
|
||||
++ dejs
|
||||
=, dejs:format
|
||||
|%
|
||||
@ -27,6 +26,7 @@
|
||||
set-watch-on-self+bo
|
||||
==
|
||||
--
|
||||
::
|
||||
++ enjs
|
||||
=, enjs:format
|
||||
|%
|
||||
@ -42,7 +42,7 @@
|
||||
|= act=^action
|
||||
^- json
|
||||
%+ frond -.act
|
||||
?- -.act
|
||||
?- -.act
|
||||
%set-watch-on-self b+watch-on-self.act
|
||||
%set-mentions b+mentions.act
|
||||
?(%listen %ignore) (graph-index graph.act index.act)
|
||||
|
@ -4,11 +4,9 @@
|
||||
=< [. sur]
|
||||
=, sur
|
||||
|%
|
||||
::
|
||||
++ dejs
|
||||
=, dejs:format
|
||||
|%
|
||||
::
|
||||
++ action
|
||||
%- of
|
||||
:~ listen+dejs-path:resource
|
||||
@ -19,18 +17,18 @@
|
||||
++ enjs
|
||||
=, enjs:format
|
||||
|%
|
||||
::
|
||||
++ res
|
||||
(cork enjs-path:resource (lead %s))
|
||||
::
|
||||
++ update
|
||||
|= upd=^update
|
||||
%+ frond -.upd
|
||||
?- -.upd
|
||||
?(%listen %ignore) (res group.upd)
|
||||
::
|
||||
%initial
|
||||
:- %a
|
||||
(turn ~(tap in watching.upd) res)
|
||||
::
|
||||
?(%listen %ignore) (res group.upd)
|
||||
==
|
||||
--
|
||||
--
|
||||
|
@ -68,7 +68,6 @@
|
||||
++ enjs
|
||||
=, enjs:format
|
||||
|%
|
||||
::
|
||||
++ update
|
||||
|= upd=^update
|
||||
^- json
|
||||
@ -80,6 +79,7 @@
|
||||
%set-dnd b+dnd.upd
|
||||
%count (numb count.upd)
|
||||
%more (more +.upd)
|
||||
::
|
||||
?(%archive %read %unread)
|
||||
(notif-ref +.upd)
|
||||
==
|
||||
@ -210,11 +210,3 @@
|
||||
--
|
||||
--
|
||||
--
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -107,6 +107,10 @@
|
||||
%graph-store
|
||||
%graph-pull-hook
|
||||
%graph-push-hook
|
||||
%hark-store
|
||||
%hark-graph-hook
|
||||
%hark-group-hook
|
||||
%hark-chat-hook
|
||||
==
|
||||
::
|
||||
++ deft-fish :: default connects
|
||||
@ -209,7 +213,7 @@
|
||||
==
|
||||
::
|
||||
++ on-load
|
||||
|= [hood-version=?(%1 %2 %3 %4 %5 %6 %7 %8 %9 %10) old=any-state]
|
||||
|= [hood-version=@ud old=any-state]
|
||||
=< se-abet =< se-view
|
||||
=. sat old
|
||||
=. dev (~(gut by bin) ost *source)
|
||||
@ -241,6 +245,11 @@
|
||||
=? ..on-load (lte hood-version %10)
|
||||
=> (se-born | %home %graph-push-hook)
|
||||
(se-born | %home %graph-pull-hook)
|
||||
=? ..on-load (lte hood-version %11)
|
||||
=> (se-born | %home %hark-graph-hook)
|
||||
=> (se-born | %home %hark-group-hook)
|
||||
=> (se-born | %home %hark-chat-hook)
|
||||
(se-born | %home %hark-store)
|
||||
..on-load
|
||||
::
|
||||
++ reap-phat :: ack connect
|
||||
|
@ -1,6 +1,5 @@
|
||||
^?
|
||||
|%
|
||||
::
|
||||
+$ action
|
||||
$% [?(%listen %ignore) chat=path]
|
||||
[%set-mentions mentions=?]
|
||||
|
@ -1,7 +1,6 @@
|
||||
/- *resource, graph-store, post
|
||||
^?
|
||||
|%
|
||||
::
|
||||
+$ action
|
||||
$%
|
||||
[?(%listen %ignore) graph=resource =index:post]
|
||||
@ -19,4 +18,3 @@
|
||||
==
|
||||
==
|
||||
--
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
/- *resource
|
||||
^?
|
||||
|%
|
||||
::
|
||||
+$ action
|
||||
[?(%listen %ignore) group=resource]
|
||||
::
|
||||
@ -9,6 +8,4 @@
|
||||
$% action
|
||||
[%initial watching=(set resource)]
|
||||
==
|
||||
::
|
||||
--
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
/- *resource, graph-store, post, group-store, metadata-store, chat-store
|
||||
^?
|
||||
|%
|
||||
::
|
||||
+$ index
|
||||
$% [%graph group=resource graph=resource module=@t description=@t]
|
||||
[%group group=resource description=@t]
|
||||
|
@ -22,7 +22,6 @@
|
||||
;< ~ bind:m
|
||||
(poke-our %group-push-hook %push-hook-action !>([%add rid]))
|
||||
(pure:m rid)
|
||||
::
|
||||
--
|
||||
::
|
||||
=, strand=strand:spider
|
||||
|
Loading…
Reference in New Issue
Block a user