mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-20 15:08:34 +03:00
contact: improved +is-allowed and added %contact-share mark
This commit is contained in:
parent
33eabe2574
commit
a728514aa5
@ -3,7 +3,7 @@
|
|||||||
:: data store that holds individual contact data
|
:: data store that holds individual contact data
|
||||||
::
|
::
|
||||||
/- store=contact-store, *resource
|
/- store=contact-store, *resource
|
||||||
/+ default-agent, dbug, *migrate
|
/+ default-agent, dbug, *migrate, contact
|
||||||
|%
|
|%
|
||||||
+$ card card:agent:gall
|
+$ card card:agent:gall
|
||||||
+$ state-4
|
+$ state-4
|
||||||
@ -29,6 +29,7 @@
|
|||||||
|_ =bowl:gall
|
|_ =bowl:gall
|
||||||
+* this .
|
+* this .
|
||||||
def ~(. (default-agent this %|) bowl)
|
def ~(. (default-agent this %|) bowl)
|
||||||
|
con ~(. contact bowl)
|
||||||
::
|
::
|
||||||
++ on-init
|
++ on-init
|
||||||
=. rolodex (~(put by rolodex) our.bowl *contact:store)
|
=. rolodex (~(put by rolodex) our.bowl *contact:store)
|
||||||
@ -216,6 +217,12 @@
|
|||||||
::
|
::
|
||||||
[%x %allowed-groups ~]
|
[%x %allowed-groups ~]
|
||||||
``noun+!>(allowed-groups)
|
``noun+!>(allowed-groups)
|
||||||
|
|
||||||
|
::
|
||||||
|
[%x %is-allowed @ ~]
|
||||||
|
=/ =ship (slav %p i.t.t.path)
|
||||||
|
~& ship
|
||||||
|
``json+!>(`json`b+(is-allowed:con [our.bowl %''] ship))
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ on-leave on-leave:def
|
++ on-leave on-leave:def
|
||||||
|
@ -173,4 +173,10 @@
|
|||||||
==
|
==
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
|
::
|
||||||
|
++ share-dejs
|
||||||
|
=, dejs:format
|
||||||
|
|%
|
||||||
|
++ share (ot [%share (su ;~(pfix sig fed:ag))]~)
|
||||||
|
--
|
||||||
--
|
--
|
||||||
|
@ -70,20 +70,21 @@
|
|||||||
|= [rid=resource =ship]
|
|= [rid=resource =ship]
|
||||||
^- ?
|
^- ?
|
||||||
=/ grp ~(. group bowl)
|
=/ grp ~(. group bowl)
|
||||||
=/ shp (scry-for ? /allowed-ship/(scot %p ship))
|
:: if they are requesting our personal profile, check if we are
|
||||||
?: ?& scry-is-public
|
:: either public, or if they are on the allowed-ships list.
|
||||||
=(rid [our.bowl %''])
|
:: this is used for direct messages and leap searches
|
||||||
|
::
|
||||||
|
?: ?& =(rid [our.bowl %''])
|
||||||
|
?| scry-is-public
|
||||||
|
(scry-for ? /allowed-ship/(scot %p ship))
|
||||||
==
|
==
|
||||||
%.y
|
%.y
|
||||||
?: shp %.y
|
:: if they are requesting our profile within a group, make sure we
|
||||||
?: ?& (~(has in scry-sharing) rid)
|
:: are the host of that group and that they are a member of the group
|
||||||
(~(has in (members:grp rid)) ship)
|
::
|
||||||
==
|
=/ allowed-groups (scry-for (set resource) /allowed-groups)
|
||||||
%.y
|
?& (~(has in allowed-groups) rid)
|
||||||
=/ allowed-groups ~(tap in (scry-for (set resource) /allowed-groups))
|
(~(has in scry-sharing) rid)
|
||||||
|-
|
(~(has in (members:grp rid)) ship)
|
||||||
?~ allowed-groups %.n
|
==
|
||||||
?: (~(has in (members:grp i.allowed-groups)) ship)
|
|
||||||
%.y
|
|
||||||
$(allowed-groups t.allowed-groups)
|
|
||||||
--
|
--
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/+ *contact-store
|
||||||
|
::
|
||||||
|_ share=[%share =ship]
|
|_ share=[%share =ship]
|
||||||
++ grad %noun
|
++ grad %noun
|
||||||
++ grow
|
++ grow
|
||||||
@ -8,5 +10,6 @@
|
|||||||
++ grab
|
++ grab
|
||||||
|%
|
|%
|
||||||
++ noun share
|
++ noun share
|
||||||
|
++ json share:share-dejs
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
|
Loading…
Reference in New Issue
Block a user