From 86e8e5199e2becd2e3ec72f402e5e32f9e9c9851 Mon Sep 17 00:00:00 2001 From: Nate Morrison Date: Fri, 4 Dec 2015 08:41:13 +0100 Subject: [PATCH] Filenames added to audit log in the LocalIndexUpdated event (fixes #2549) --- lib/model/model.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/model/model.go b/lib/model/model.go index edc09eea..020d57af 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -1128,10 +1128,16 @@ func (m *Model) updateLocals(folder string, fs []protocol.FileInfo) { m.fmut.RUnlock() files.Update(protocol.LocalDeviceID, fs) + filenames := make([]string, len(fs)) + for i, file := range fs { + filenames[i] = file.Name + } + events.Default.Log(events.LocalIndexUpdated, map[string]interface{}{ - "folder": folder, - "items": len(fs), - "version": files.LocalVersion(protocol.LocalDeviceID), + "folder": folder, + "items": len(fs), + "filenames": filenames, + "version": files.LocalVersion(protocol.LocalDeviceID), }) }