Add User To Channel api route returns a 400 error when trying to add users to a DM or GM channel (#7587)

Этот коммит содержится в:
Santos Solorzano
2017-10-12 10:54:37 -07:00
коммит произвёл Joram Wilander
родитель fe41022353
Коммит a7afadec3a

Просмотреть файл

@@ -826,6 +826,11 @@ func addChannelMember(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
if channel.Type == model.CHANNEL_DIRECT || channel.Type == model.CHANNEL_GROUP {
c.Err = model.NewAppError("addUserToChannel", "api.channel.add_user_to_channel.type.app_error", nil, "", http.StatusBadRequest)
return
}
if cm, err := c.App.AddChannelMember(member.UserId, channel, c.Session.UserId); err != nil {
c.Err = err
return