chat-cli: add scry helper

This commit is contained in:
Fang 2020-03-10 23:31:18 +01:00
parent 9d0fe998c1
commit 2c1539742b
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -803,14 +803,9 @@
=; perm=(unit permission) =; perm=(unit permission)
?~(perm ~ `?=(%white kind.u.perm)) ?~(perm ~ `?=(%white kind.u.perm))
::TODO +permission-of-target? ::TODO +permission-of-target?
.^ (unit permission) %^ scry-for (unit permission)
%gx %permission-store
(scot %p our-self) [%permission path]
%permission-store
(scot %da now.bowl)
%permission
(snoc path %noun)
==
?~ whitelist ?~ whitelist
~& [%weird-no-permission path] ~& [%weird-no-permission path]
~ ~
@ -1000,12 +995,9 @@
:_ ~ :_ ~
%- print-more:sh-out %- print-more:sh-out
=/ all =/ all
::TODO refactor %^ scry-for (set path)
::TODO remote scries fail... but moon support? %chat-store
.^ (set path) /keys
%gx
/(scot %p our-self)/chat-store/(scot %da now.bowl)/keys/noun
==
%+ turn ~(tap in all) %+ turn ~(tap in all)
%+ cork path-to-target %+ cork path-to-target
|= target |= target
@ -1379,4 +1371,16 @@
[(sub wid u.ace) &] [(sub wid u.ace) &]
:- (tufa (scag end `(list @)`txt)) :- (tufa (scag end `(list @)`txt))
$(txt (slag ?:(nex +(end) end) `tape`txt)) $(txt (slag ?:(nex +(end) end) `tape`txt))
::
::NOTE anything that uses this breaks moons support, because moons don't sync
:: full app state rn
++ scry-for
|* [=mold app=term =path]
.^ mold
%gx
(scot %p our.bowl)
app
(scot %da now.bowl)
(snoc `^path`path %noun)
==
-- --