summaryrefslogtreecommitdiffstats
path: root/api4/channel.go
diff options
context:
space:
mode:
Diffstat (limited to 'api4/channel.go')
-rw-r--r--api4/channel.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/api4/channel.go b/api4/channel.go
index 7a1324883..07e48b46f 100644
--- a/api4/channel.go
+++ b/api4/channel.go
@@ -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