mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
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:
committed by
George Goldberg
parent
6d2fa0f3d2
commit
8d8a4d8614
@@ -135,10 +135,16 @@ func doCommand(a *App, args *model.CommandArgs, message string) *model.CommandRe
|
||||
}
|
||||
|
||||
if err = a.RemoveUserFromChannel(userProfile.Id, args.UserId, channel); err != nil {
|
||||
return &model.CommandResponse{
|
||||
Text: args.T(err.Id, map[string]interface{}{
|
||||
var text string
|
||||
if err.Id == "api.channel.remove_members.denied" {
|
||||
text = args.T("api.command_remove.group_constrained_user_denied")
|
||||
} else {
|
||||
text = args.T(err.Id, map[string]interface{}{
|
||||
"Channel": model.DEFAULT_CHANNEL,
|
||||
}),
|
||||
})
|
||||
}
|
||||
return &model.CommandResponse{
|
||||
Text: text,
|
||||
ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user