metadata-push-hook: stop syncing dms
::
/- *group, *invite-store, store=metadata-store
/+ default-agent, verb, dbug, grpl=group, push-hook,
- resource, mdl=metadata, gral=graph
+ resource, mdl=metadata, gral=graph, agentio
~% %group-hook-top ..part ~
|%
+$ card card:agent:gall
==
::
+$ agent (push-hook:push-hook config)
+::
++$ state-null ~
++$ state-zero [%0 ~]
+::
++$ versioned-state
+ $% state-null
+ state-zero
+ ==
--
::
::
+=| state-zero
+=* state -
%- agent:dbug
%+ verb |
^- agent:gall
grp ~(. grpl bowl)
met ~(. mdl bowl)
gra ~(. gral bowl)
+ io ~(. agentio bowl)
+ pass pass:io
::
++ on-init on-init:def
-++ on-save !>(~)
-++ on-load on-load:def
+++ on-save !>(state)
+++ on-load
+ |= old=vase
+ ^- (quip card _this)
+ =+ !<(sta=versioned-state old)
+ ?^ sta `this(state sta)
+ :_ this(state *state-zero)
+ (poke-self:pass noun+!>(%clean-dm))^~
+::
++ on-poke
|= [=mark =vase]
- ?. ?=(%metadata-hook-update mark)
- (on-poke:def mark vase)
+ |^ ^- (quip card _this)
+ ?+ mark (on-poke:def mark vase)
+ %metadata-hook-update metadata-hook-update
+ %noun noun
+ ==
+ ::
+ ++ metadata-hook-update
=+ !<(=hook-update:store vase)
?. ?=(%req-preview -.hook-update)
(on-poke:def mark vase)
=- [%pass / %agent [src.bowl %metadata-pull-hook] %poke -]~
metadata-hook-update+!>(`hook-update:store`[%preview group-preview])
::
+ ++ noun
+ ?+ q.vase ~|("unknown noun poke" !!)
+ ::
+ %clean-dm
+ =+ .^(sharing=(set resource) (scry:io %gx dap.bowl /sharing/noun))
+ :_ this
+ %+ murn ~(tap in sharing)
+ |= rid=resource
+ ^- (unit card)
+ ?@ (rush name.rid ;~(pfix (jest 'dm--') fed:ag)) ~
+ `(poke-self:pass push-hook-action+!>([%remove rid]))
+ ==
+ --
+::
++ on-agent on-agent:def
++ on-watch on-watch:def
++ on-leave on-leave:def
