Merge pull request #2391 from urbit/is-creator

chat: only delete metadata for a chat if you created it OR it's an unmanaged chat
This commit is contained in:
Logan 2020-03-03 18:02:46 -08:00 committed by GitHub
commit f636dbf833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 2 deletions

View File

@ -224,13 +224,16 @@
?> ?=(^ app-path.act)
%- zing
:~ :~ (chat-hook-poke [%remove app-path.act])
(metadata-poke [%remove group-path [%chat app-path.act]])
(chat-poke [%delete app-path.act])
==
::
?. (is-creator group-path %chat app-path.act) ~
[(metadata-poke [%remove group-path [%chat app-path.act]])]~
::
?: (is-managed group-path) ~
:~ (group-poke [%unbundle group-path])
(metadata-hook-poke [%remove group-path])
(metadata-store-poke [%remove group-path [%chat app-path.act]])
==
==
::
@ -314,6 +317,11 @@
^- card
[%pass / %agent [our.bol %metadata-hook] %poke %metadata-action !>(act)]
::
++ metadata-store-poke
|= act=metadata-action
^- card
[%pass / %agent [our.bol %metadata-store] %poke %metadata-action !>(act)]
::
++ metadata-hook-poke
|= act=metadata-hook-action
^- card
@ -364,6 +372,23 @@
^- ?
?> ?=(^ path)
!=(i.path '~')
::
++ is-creator
|= [group-path=path app-name=@ta app-path=path]
^- ?
=/ =metadata
.^ metadata
%gx
(scot %p our.bol)
%metadata-store
(scot %da now.bol)
%metadata
(scot %t (spat group-path))
app-name
(scot %t (spat app-path))
/noun
==
=(our.bol creator.metadata)
--
::
++ diff-chat-update

File diff suppressed because one or more lines are too long