diff options
author | Chris <ccbrown112@gmail.com> | 2017-10-20 17:33:20 -0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-10-20 20:33:20 -0400 |
commit | d39a722a819b154d260b90905065a000749778b6 (patch) | |
tree | 94d9a1de7bea296e135624c60bdd2147be344aab /app/channel.go | |
parent | 812f5664016deb596281d8119321833beafd4599 (diff) | |
download | chat-d39a722a819b154d260b90905065a000749778b6.tar.gz chat-d39a722a819b154d260b90905065a000749778b6.tar.bz2 chat-d39a722a819b154d260b90905065a000749778b6.zip |
refactor max channels per team enforcement (#7690)
Diffstat (limited to 'app/channel.go')
-rw-r--r-- | app/channel.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/channel.go b/app/channel.go index 29e2309cf..465f2cc80 100644 --- a/app/channel.go +++ b/app/channel.go @@ -142,7 +142,7 @@ func (a *App) CreateChannelWithUser(channel *model.Channel, userId string) (*mod } func (a *App) CreateChannel(channel *model.Channel, addMember bool) (*model.Channel, *model.AppError) { - if result := <-a.Srv.Store.Channel().Save(channel); result.Err != nil { + if result := <-a.Srv.Store.Channel().Save(channel, *a.Config().TeamSettings.MaxChannelsPerTeam); result.Err != nil { return nil, result.Err } else { sc := result.Data.(*model.Channel) @@ -282,7 +282,7 @@ func (a *App) createGroupChannel(userIds []string, creatorId string) (*model.Cha Type: model.CHANNEL_GROUP, } - if result := <-a.Srv.Store.Channel().Save(group); result.Err != nil { + if result := <-a.Srv.Store.Channel().Save(group, *a.Config().TeamSettings.MaxChannelsPerTeam); result.Err != nil { if result.Err.Id == store.CHANNEL_EXISTS_ERROR { return result.Data.(*model.Channel), result.Err } else { |