chat-hook: on-migrate, configure permission-hook also
Permissions for the new group need to be exposed to the members of those
new groups. This makes the on-migrate logic poke the permission-hook for
that.
:: mirror chat data from foreign to local based on read permissions
:: allow sending chat messages to foreign paths based on write perms
::
-/- *permission-store, *chat-hook, *invite-store,
- *metadata-store, *permission-group-hook, *group-store
+/- *permission-store, *chat-hook, *invite-store, *metadata-store,
+ *permission-hook, *group-store, *permission-group-hook ::TMP for upgrade
/+ *chat-json, *chat-eval, default-agent, verb, dbug
|%
+$ card card:agent:gall
==
::
(create-group new-group who.newp)
- ::
- :~ (record-group new-group chat)
(hookup-group new-group kind.newp)
- ==
+ [(record-group new-group chat)]~
==
::
++ unify-permissions
::
++ hookup-group
|= [group=path =kind]
- ^- card
- %^ make-poke %permission-group-hook
+ ^- (list card)
+ :* %^ make-poke %permission-group-hook
%permission-group-hook-action
!> ^- permission-group-hook-action
[%associate group [group^kind ~ ~]]
+ ::
+ =/ =ship (slav %p (snag 1 group))
+ ?. =(our.bol ship) ~
+ :_ ~
+ %^ make-poke %permission-hook
+ %permission-hook-action
+ !> ^- permission-hook-action
+ [%add-owned group group]
+ ==
::
++ record-group
|= [group=path chat=path]
