Use a separate, unique ID for usage reporting (fixes #1000)

This commit is contained in:
Jakob Borg
2014-11-27 10:00:07 +01:00
parent 82e923dfc8
commit 5251f1c9db
4 changed files with 15 additions and 2 deletions

View File

@@ -173,6 +173,7 @@ type OptionsConfiguration struct {
UPnPLease int `xml:"upnpLeaseMinutes" default:"0"`
UPnPRenewal int `xml:"upnpRenewalMinutes" default:"30"`
URAccepted int `xml:"urAccepted"` // Accepted usage reporting version; 0 for off (undecided), -1 for off (permanently)
URUniqueID string `xml:"urUniqueID"` // Unique ID for reporting purposes, regenerated when UR is turned on.
RestartOnWakeup bool `xml:"restartOnWakeup" default:"true"`
AutoUpgradeIntervalH int `xml:"autoUpgradeIntervalH" default:"12"` // 0 for off
KeepTemporariesH int `xml:"keepTemporariesH" default:"24"` // 0 for off
@@ -278,6 +279,7 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) {
if cfg.Options.Deprecated_URDeclined {
cfg.Options.URAccepted = -1
cfg.Options.URUniqueID = ""
}
cfg.Options.Deprecated_URDeclined = false
cfg.Options.Deprecated_UREnabled = false
@@ -381,6 +383,10 @@ func ChangeRequiresRestart(from, to Configuration) bool {
}
}
// Changing usage reporting to on or off does not require a restart.
to.Options.URAccepted = from.Options.URAccepted
to.Options.URUniqueID = from.Options.URUniqueID
// All of the generic options require restart
if !reflect.DeepEqual(from.Options, to.Options) || !reflect.DeepEqual(from.GUI, to.GUI) {
return true