summaryrefslogtreecommitdiffstats
path: root/utils/config.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2018-01-05 16:17:57 -0600
committerGitHub <noreply@github.com>2018-01-05 16:17:57 -0600
commit591ef9f352efd98a85e6d04c0c9072c4c2987527 (patch)
tree2768aed148df1fba4a3e6d9c43057cf64199d6a1 /utils/config.go
parentfd3fa8f8dcfa5de42a16db9b62e1d6628f43b0fd (diff)
downloadchat-591ef9f352efd98a85e6d04c0c9072c4c2987527.tar.gz
chat-591ef9f352efd98a85e6d04c0c9072c4c2987527.tar.bz2
chat-591ef9f352efd98a85e6d04c0c9072c4c2987527.zip
Remove utils.ClientCfg and utils.ClientCfgHash (#8041)
* remove utils.ClientCfg and utils.ClientCfgHash * remove unused import
Diffstat (limited to 'utils/config.go')
-rw-r--r--utils/config.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/utils/config.go b/utils/config.go
index e2622cff9..d75ec732b 100644
--- a/utils/config.go
+++ b/utils/config.go
@@ -37,12 +37,9 @@ const (
var cfgMutex = &sync.Mutex{}
var watcher *fsnotify.Watcher
var Cfg *model.Config = &model.Config{}
-var CfgDiagnosticId = ""
var CfgHash = ""
-var ClientCfgHash = ""
var CfgFileName string = ""
var CfgDisableConfigWatch = false
-var ClientCfg map[string]string = map[string]string{}
var originalDisableDebugLvl l4g.Level = l4g.DEBUG
var siteURL = ""
@@ -416,9 +413,6 @@ func LoadGlobalConfig(fileName string) *model.Config {
Cfg = config
CfgHash = fmt.Sprintf("%x", md5.Sum([]byte(Cfg.ToJson())))
- ClientCfg = getClientConfig(Cfg)
- clientCfgJson, _ := json.Marshal(ClientCfg)
- ClientCfgHash = fmt.Sprintf("%x", md5.Sum(clientCfgJson))
SetSiteURL(*Cfg.ServiceSettings.SiteURL)
@@ -433,11 +427,7 @@ func InvokeGlobalConfigListeners(old, current *model.Config) {
}
}
-func RegenerateClientConfig() {
- ClientCfg = getClientConfig(Cfg)
-}
-
-func getClientConfig(c *model.Config) map[string]string {
+func GenerateClientConfig(c *model.Config, diagnosticId string) map[string]string {
props := make(map[string]string)
props["Version"] = model.CurrentVersion
@@ -544,7 +534,7 @@ func getClientConfig(c *model.Config) map[string]string {
props["EnableUserTypingMessages"] = strconv.FormatBool(*c.ServiceSettings.EnableUserTypingMessages)
props["EnableChannelViewedMessages"] = strconv.FormatBool(*c.ServiceSettings.EnableChannelViewedMessages)
- props["DiagnosticId"] = CfgDiagnosticId
+ props["DiagnosticId"] = diagnosticId
props["DiagnosticsEnabled"] = strconv.FormatBool(*c.LogSettings.EnableDiagnostics)
props["PluginsEnabled"] = strconv.FormatBool(*c.PluginSettings.Enable)