Merge pull request #2427 from urbit/chat-invites

chat: only send invites for unmanaged chats
This commit is contained in:
ixv 2020-03-09 20:42:51 -07:00 committed by GitHub
commit bc1adfa509
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 14 deletions

View File

@ -482,7 +482,7 @@
%+ turn ~(tap in who)
|= =ship
?: (is-permitted ship chat)
?: ?|(=(kind %remove) =(ship our.bol)) ~
?: ?|(=(kind %remove) =(ship our.bol) (is-managed pax)) ~
:: if ship has just been added to the permitted group,
:: send them an invite
~[(send-invite chat ship)]
@ -495,6 +495,12 @@
=/ =invite [our.bol %chat-hook path ship '']
=/ act=invite-action [%invite /chat (shaf %msg-uid eny.bol) invite]
[%pass / %agent [our.bol %invite-hook] %poke %invite-action !>(act)]
::
++ is-managed
|= =path
^- ?
?> ?=(^ path)
!=(i.path '~')
--
::
++ fact-chat-update

View File

@ -257,13 +257,7 @@
++ create-group
|= [=path app-path=path sec=rw-security ships=(set ship) title=@t desc=@t]
^- (list card)
=/ group (group-scry path)
?^ group
%- zing
%+ turn ~(tap in u.group)
|= =ship
?: =(ship our.bol) ~
[(send-invite app-path ship)]~
?^ (group-scry path) ~
:: do not create a managed group if this is a sig path or a blacklist
::
?: =(sec %channel)
@ -273,11 +267,17 @@
==
?: (is-managed path)
~[(contact-view-poke [%create path ships title desc])]
:~ (group-poke [%bundle path])
(group-poke [%add ships path])
(create-security path sec)
(permission-hook-poke [%add-owned path path])
==
%+ welp
:~ (group-poke [%bundle path])
(group-poke [%add ships path])
(create-security path sec)
(permission-hook-poke [%add-owned path path])
==
%- zing
%+ turn ~(tap in ships)
|= =ship
?: =(ship our.bol) ~
[(send-invite app-path ship)]~
::
++ create-security
|= [pax=path sec=rw-security]

File diff suppressed because one or more lines are too long