Adding offical build function

This commit is contained in:
=Corey Hulen
2015-10-02 09:01:50 -07:00
parent b2052de746
commit 3863c3c15e
3 changed files with 6 additions and 2 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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 {