mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 10:02:47 +03:00
group-hook: on %path group-update, don't %unbundle
Instead, %bundle and %add if we don't have the group locally yet, or %add and %remove whatever the difference is between the local group and the group as specified in the %path update.
This commit is contained in:
parent
4940501f3b
commit
4551c74e3a
@ -191,10 +191,23 @@
|
||||
=/ ship (~(get by synced.state) pax.diff)
|
||||
?~ ship ~
|
||||
?. =(src.bol u.ship) ~
|
||||
:~ (group-poke pax.diff [%unbundle pax.diff])
|
||||
(group-poke pax.diff [%bundle pax.diff])
|
||||
(group-poke pax.diff [%add members.diff pax.diff])
|
||||
==
|
||||
=/ have-group=(unit group)
|
||||
(group-scry pax.diff)
|
||||
?~ have-group
|
||||
:: if we don't have the group yet, create it
|
||||
::
|
||||
:~ (group-poke pax.diff [%bundle pax.diff])
|
||||
(group-poke pax.diff [%add members.diff pax.diff])
|
||||
==
|
||||
:: if we already have the group, calculate and apply the diff
|
||||
::
|
||||
=/ added=group (~(dif in members.diff) u.have-group)
|
||||
=/ removed=group (~(dif in u.have-group) members.diff)
|
||||
%+ weld
|
||||
?~ added ~
|
||||
[(group-poke pax.diff [%add added pax.diff])]~
|
||||
?~ removed ~
|
||||
[(group-poke pax.diff [%remove removed pax.diff])]~
|
||||
::
|
||||
%add
|
||||
:_ state
|
||||
|
Loading…
Reference in New Issue
Block a user