MM-15485: In-channel system behaviour for at-mentions and slash commands for group-constrained channels. (#10855)

* MM-15108: Prevent non-group-members from being added to group-constrained channels.

* MM-15485: Updates ephemeral message when non-group member is invited to group-constrained channel.

* MM-15485: Prevent group-permitted members from being removed from group-constrained channels. Show custom ephemeral when attempting /kick or /remove.
This commit is contained in:
Martin Kraft
2019-05-17 07:43:19 -04:00
committed by George Goldberg
parent 6d2fa0f3d2
commit 8d8a4d8614
11 changed files with 72 additions and 16 deletions

View File

@@ -206,6 +206,10 @@ func (o *Channel) AddProp(key string, value interface{}) {
o.Props[key] = value
}
func (o *Channel) IsGroupConstrained() bool {
return o.GroupConstrained != nil && *o.GroupConstrained
}
func GetDMNameFromIds(userId1, userId2 string) string {
if userId1 > userId2 {
return userId2 + "__" + userId1

View File

@@ -280,6 +280,10 @@ func (t *Team) Patch(patch *TeamPatch) {
}
}
func (t *Team) IsGroupConstrained() bool {
return t.GroupConstrained != nil && *t.GroupConstrained
}
func (t *TeamPatch) ToJson() string {
b, err := json.Marshal(t)
if err != nil {