diff options
author | =Corey Hulen <corey@hulen.com> | 2015-10-02 09:01:50 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-10-02 09:01:50 -0700 |
commit | 3863c3c15e72a278ed439c02b189eba6cccd94ac (patch) | |
tree | ef16793aa00a158da78b8e5bac5e001636d1ed6f | |
parent | b2052de746f8e5f4ca600142fd43b64ceb6c8b84 (diff) | |
download | chat-3863c3c15e72a278ed439c02b189eba6cccd94ac.tar.gz chat-3863c3c15e72a278ed439c02b189eba6cccd94ac.tar.bz2 chat-3863c3c15e72a278ed439c02b189eba6cccd94ac.zip |
Adding offical build function
-rw-r--r-- | mattermost.go | 2 | ||||
-rw-r--r-- | model/version.go | 4 | ||||
-rw-r--r-- | utils/diagnostic.go | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/mattermost.go b/mattermost.go index de4c4b883..e78e8d04a 100644 --- a/mattermost.go +++ b/mattermost.go @@ -78,7 +78,7 @@ func main() { func diagnosticsJob() { go func() { for { - if utils.Cfg.PrivacySettings.EnableDiagnostic && model.BuildNumber != "_BUILD_NUMBER_" { + if utils.Cfg.PrivacySettings.EnableDiagnostic && !model.IsOfficalBuild() { if result := <-api.Srv.Store.System().Get(); result.Err == nil { props := result.Data.(model.StringMap) lastTime, _ := strconv.ParseInt(props["LastDiagnosticTime"], 10, 0) diff --git a/model/version.go b/model/version.go index 233fc3747..f4cd4387f 100644 --- a/model/version.go +++ b/model/version.go @@ -67,6 +67,10 @@ func GetPreviousVersion(currentVersion string) (int64, int64) { return 0, 0 } +func IsOfficalBuild() bool { + return model.BuildNumber != "_BUILD_NUMBER_" +} + func IsCurrentVersion(versionToCheck string) bool { currentMajor, currentMinor, _ := SplitVersion(CurrentVersion) toCheckMajor, toCheckMinor, _ := SplitVersion(versionToCheck) diff --git a/utils/diagnostic.go b/utils/diagnostic.go index 2f3893cec..9a61ae934 100644 --- a/utils/diagnostic.go +++ b/utils/diagnostic.go @@ -22,7 +22,7 @@ const ( ) func SendDiagnostic(data model.StringMap) *model.AppError { - if Cfg.PrivacySettings.EnableDiagnostic && model.BuildNumber != "_BUILD_NUMBER_" { + if Cfg.PrivacySettings.EnableDiagnostic && !model.IsOfficalBuild() { query := "?" for name, value := range data { |