summaryrefslogtreecommitdiffstats
path: root/app/channel.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-18 15:36:43 -0700
committerGitHub <noreply@github.com>2017-10-18 15:36:43 -0700
commit8e19ba029f889519d93cf272960dce858971106c (patch)
treed8f38ac62661fb8578e2b5c3c619fe31ab29f480 /app/channel.go
parent34a87fa8f47b1447b73e3ae56866b654801b3eee (diff)
downloadchat-8e19ba029f889519d93cf272960dce858971106c.tar.gz
chat-8e19ba029f889519d93cf272960dce858971106c.tar.bz2
chat-8e19ba029f889519d93cf272960dce858971106c.zip
Reduce utils.Cfg references (#7650)
* app.UpdateConfig method * test fix * another test fix * the config override option as-was is just error prone, remove it for now * derp
Diffstat (limited to 'app/channel.go')
-rw-r--r--app/channel.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/channel.go b/app/channel.go
index 2ab591c42..29e2309cf 100644
--- a/app/channel.go
+++ b/app/channel.go
@@ -114,8 +114,8 @@ func (a *App) CreateChannelWithUser(channel *model.Channel, userId string) (*mod
if count, err := a.GetNumberOfChannelsOnTeam(channel.TeamId); err != nil {
return nil, err
} else {
- if int64(count+1) > *utils.Cfg.TeamSettings.MaxChannelsPerTeam {
- return nil, model.NewAppError("CreateChannelWithUser", "api.channel.create_channel.max_channel_limit.app_error", map[string]interface{}{"MaxChannelsPerTeam": *utils.Cfg.TeamSettings.MaxChannelsPerTeam}, "", http.StatusBadRequest)
+ if int64(count+1) > *a.Config().TeamSettings.MaxChannelsPerTeam {
+ return nil, model.NewAppError("CreateChannelWithUser", "api.channel.create_channel.max_channel_limit.app_error", map[string]interface{}{"MaxChannelsPerTeam": *a.Config().TeamSettings.MaxChannelsPerTeam}, "", http.StatusBadRequest)
}
}
@@ -212,7 +212,7 @@ func (a *App) createDirectChannel(userId string, otherUserId string) (*model.Cha
}
func (a *App) WaitForChannelMembership(channelId string, userId string) {
- if len(utils.Cfg.SqlSettings.DataSourceReplicas) > 0 {
+ if len(a.Config().SqlSettings.DataSourceReplicas) > 0 {
now := model.GetMillis()
for model.GetMillis()-now < 12000 {
@@ -1119,7 +1119,7 @@ func (a *App) UpdateChannelLastViewedAt(channelIds []string, userId string) *mod
return result.Err
}
- if *utils.Cfg.ServiceSettings.EnableChannelViewedMessages {
+ if *a.Config().ServiceSettings.EnableChannelViewedMessages {
for _, channelId := range channelIds {
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_VIEWED, "", "", userId, nil)
message.Add("channel_id", channelId)
@@ -1163,7 +1163,7 @@ func (a *App) ViewChannel(view *model.ChannelView, userId string, clearPushNotif
if len(view.PrevChannelId) > 0 {
channelIds = append(channelIds, view.PrevChannelId)
- if *utils.Cfg.EmailSettings.SendPushNotifications && clearPushNotifications && len(view.ChannelId) > 0 {
+ if *a.Config().EmailSettings.SendPushNotifications && clearPushNotifications && len(view.ChannelId) > 0 {
pchan = a.Srv.Store.User().GetUnreadCountForChannel(userId, view.ChannelId)
}
}
@@ -1191,7 +1191,7 @@ func (a *App) ViewChannel(view *model.ChannelView, userId string, clearPushNotif
times = result.Data.(map[string]int64)
}
- if *utils.Cfg.ServiceSettings.EnableChannelViewedMessages && model.IsValidId(view.ChannelId) {
+ if *a.Config().ServiceSettings.EnableChannelViewedMessages && model.IsValidId(view.ChannelId) {
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_VIEWED, "", "", userId, nil)
message.Add("channel_id", view.ChannelId)
a.Go(func() {