cmd/syncthing: Do not modify events (fixes #3002)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3190
This commit is contained in:
Audrius Butkevicius 2016-05-26 06:54:44 +00:00 committed by Jakob Borg
parent fc173bf679
commit 410d700ae3

View File

@ -132,11 +132,14 @@ func (s *verboseService) formatEvent(ev events.Event) string {
case events.FolderSummary:
data := ev.Data.(map[string]interface{})
sum := data["summary"].(map[string]interface{})
delete(sum, "invalid")
delete(sum, "ignorePatterns")
delete(sum, "stateChanged")
return fmt.Sprintf("Summary for folder %q is %v", data["folder"], data["summary"])
sum := make(map[string]interface{})
for k, v := range data["summary"].(map[string]interface{}) {
if k == "invalid" || k == "ignorePatterns" || k == "stateChanged" {
continue
}
sum[k] = v
}
return fmt.Sprintf("Summary for folder %q is %v", data["folder"], sum)
case events.FolderScanProgress:
data := ev.Data.(map[string]interface{})