dm-hook: notify on pending

This commit is contained in:
Liam Fitzgerald 2021-09-21 13:34:09 +10:00
parent 2d3db95aa5
commit 9cc2d07a4e

View File

@ -1,5 +1,6 @@
:: dm-hook [landscape]: receive and send DMs :: dm-hook [landscape]: receive and send DMs
:: ::
/- hark=hark-store
/+ default-agent, dbug, store=graph-store, graphlib=graph, agentio, resource /+ default-agent, dbug, store=graph-store, graphlib=graph, agentio, resource
/+ sig=signatures, hook=dm-hook /+ sig=signatures, hook=dm-hook
:: ::
@ -202,11 +203,12 @@
?> =(1 ~(wyt by nodes)) ?> =(1 ~(wyt by nodes))
=/ ship-screen (~(get ju screened) src.bowl) =/ ship-screen (~(get ju screened) src.bowl)
=. ship-screen (~(uni in ship-screen) (normalize-incoming nodes)) =. ship-screen (~(uni in ship-screen) (normalize-incoming nodes))
=. screened (~(put by screened) src.bowl ship-screen) :_ state(screened (~(put by screened) src.bowl ship-screen))
:_ state
=/ =action:hook =/ =action:hook
[%pendings ~(key by screened)] [%pendings ~(key by screened)]
(fact:io dm-hook-action+!>(action) ~[/updates])^~ :- (fact:io dm-hook-action+!>(action) ~[/updates])
?: (~(has by screened) src.bowl) ~
(notify-pending src.bowl)^~
:: ::
++ dm-exists ++ dm-exists
|= =ship |= =ship
@ -265,6 +267,16 @@
== ==
== ==
:: ::
++ notify-pending
|= =ship
^- card
=/ =bin:hark [/ [q.byk.bowl /dm/invite]]
=/ title=(list content:hark)
[ship/ship text/' invited you to a DM' ~]
%+ poke-our:pass %hark-store
:- %hark-action
!>(`action:hark`[%add-note bin title ~ now.bowl / /dm/(scot %p ship)])
::
++ normalize-incoming ++ normalize-incoming
|= =nodes |= =nodes
^- ^nodes ^- ^nodes
@ -301,7 +313,13 @@
(fact-init:io dm-hook-action+!>([%screen screening])) (fact-init:io dm-hook-action+!>([%screen screening]))
== ==
:: ::
++ on-peek on-peek:def ++ on-peek
|= =path
^- (unit (unit cage))
?+ path (on-peek:def path)
[%x %pendings ~] ``dm-hook-action+!>([%pendings ~(key by screened)])
==
::
++ on-leave on-leave:def ++ on-leave on-leave:def
++ on-agent ++ on-agent
|= [=wire =sign:agent:gall] |= [=wire =sign:agent:gall]