summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-20 17:33:20 -0700
committerJoram Wilander <jwawilander@gmail.com>2017-10-20 20:33:20 -0400
commitd39a722a819b154d260b90905065a000749778b6 (patch)
tree94d9a1de7bea296e135624c60bdd2147be344aab /app
parent812f5664016deb596281d8119321833beafd4599 (diff)
downloadchat-d39a722a819b154d260b90905065a000749778b6.tar.gz
chat-d39a722a819b154d260b90905065a000749778b6.tar.bz2
chat-d39a722a819b154d260b90905065a000749778b6.zip
refactor max channels per team enforcement (#7690)
Diffstat (limited to 'app')
-rw-r--r--app/channel.go4
-rw-r--r--app/import.go2
2 files changed, 3 insertions, 3 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 {
diff --git a/app/import.go b/app/import.go
index 217e924b4..d6f2aae91 100644
--- a/app/import.go
+++ b/app/import.go
@@ -1476,7 +1476,7 @@ func (a *App) OldImportUser(team *model.Team, user *model.User) *model.User {
}
func (a *App) OldImportChannel(channel *model.Channel) *model.Channel {
- 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
} else {
sc := result.Data.(*model.Channel)