chat: backend work to support ~ paths

This commit is contained in:
Logan Allen 2020-02-06 11:28:58 -08:00
parent 4e2761b6a2
commit 64ff95d27c
4 changed files with 19 additions and 18 deletions

View File

@ -363,7 +363,8 @@
:_ state
[%pass /permissions %agent [our.bol %permission-store] %watch /updates]~
::
?: ?=([%mailbox @ *] wir)
?+ wir !!
[%mailbox @ *]
~& mailbox-kick+wir
?. (~(has by synced) t.wir)
:: no-op
@ -377,13 +378,17 @@
:_ state
[%pass chat-history %agent [ship %chat-hook] %watch chat-history]~
::
?. ?=([%backlog @ *] wir) !!
=/ pax `path`(oust [(dec (lent t.wir)) 1] `(list @ta)`t.wir)
?. (~(has by synced) pax) [~ state]
=/ mailbox=(unit mailbox) (chat-scry pax)
=. pax ?~(mailbox wir [%mailbox pax])
:_ state
[%pass pax %agent [(slav %p i.t.wir) %chat-hook] %watch pax]~
[%backlog @ @ *]
=/ pax `path`(oust [(dec (lent t.wir)) 1] `(list @ta)`t.wir)
?. (~(has by synced) pax) [~ state]
=/ =ship
?: =('~' i.t.wir)
(slav %p i.t.t.wir)
(slav %p i.t.wir)
=. pax ?~((chat-scry pax) wir [%mailbox pax])
:_ state
[%pass pax %agent [ship %chat-hook] %watch pax]~
==
::
++ watch-ack
|= [wir=wire saw=(unit tang)]

View File

@ -232,16 +232,12 @@
++ create-managed-group
|= [=path security=rw-security ships=(set ship)]
^- (list card)
~& [path security ships]
?. =(security %village)
:: if blacklist, do nothing but create the group if it isn't there
::
?~((group-scry path) ~[(group-poke [%bundle path])] ~)
:: if whitelist, check if group exists already. if yes, do nothing
::
?> ?=(^ path)
?^ (group-scry path) ~
:: if group does not exist, send contact-view %create
:: do not create a managed group if this is a sig path or a blacklist
::
?: |(=(i.path '~') ?!(=(security %village)))
~[(group-poke [%bundle path])]
~[(contact-view-poke [%create path ships])]
::
++ create-security

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long