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: case events.FolderSummary:
data := ev.Data.(map[string]interface{}) data := ev.Data.(map[string]interface{})
sum := data["summary"].(map[string]interface{}) sum := make(map[string]interface{})
delete(sum, "invalid") for k, v := range data["summary"].(map[string]interface{}) {
delete(sum, "ignorePatterns") if k == "invalid" || k == "ignorePatterns" || k == "stateChanged" {
delete(sum, "stateChanged") continue
return fmt.Sprintf("Summary for folder %q is %v", data["folder"], data["summary"]) }
sum[k] = v
}
return fmt.Sprintf("Summary for folder %q is %v", data["folder"], sum)
case events.FolderScanProgress: case events.FolderScanProgress:
data := ev.Data.(map[string]interface{}) data := ev.Data.(map[string]interface{})