From 962fedc37848237c3e52a652542d7574b95ed4c7 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 24 May 2023 21:12:15 +0200 Subject: [PATCH] wip --- lib/protocol/nativemodel_unix.go | 2 +- lib/protocol/nativemodel_windows.go | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/protocol/nativemodel_unix.go b/lib/protocol/nativemodel_unix.go index 90e50e394ac..c714309c6b4 100644 --- a/lib/protocol/nativemodel_unix.go +++ b/lib/protocol/nativemodel_unix.go @@ -7,4 +7,4 @@ package protocol // Normal Unixes uses NFC and slashes, which is the wire format. -func makeNative(m Model) Model { return m } +func makeNative(m contextLessModel) contextLessModel { return m } diff --git a/lib/protocol/nativemodel_windows.go b/lib/protocol/nativemodel_windows.go index c6e8bf12483..efc47d17237 100644 --- a/lib/protocol/nativemodel_windows.go +++ b/lib/protocol/nativemodel_windows.go @@ -13,30 +13,30 @@ import ( "strings" ) -func makeNative(m Model) Model { return nativeModel{m} } +func makeNative(m contextLessModel) contextLessModel { return nativeModel{m} } type nativeModel struct { - Model + contextLessModel } -func (m nativeModel) Index(deviceID DeviceID, folder string, files []FileInfo) error { +func (m nativeModel) Index(folder string, files []FileInfo) error { files = fixupFiles(files) - return m.Model.Index(deviceID, folder, files) + return m.contextLessModel.Index(folder, files) } -func (m nativeModel) IndexUpdate(deviceID DeviceID, folder string, files []FileInfo) error { +func (m nativeModel) IndexUpdate(folder string, files []FileInfo) error { files = fixupFiles(files) - return m.Model.IndexUpdate(deviceID, folder, files) + return m.contextLessModel.IndexUpdate(folder, files) } -func (m nativeModel) Request(deviceID DeviceID, folder, name string, blockNo, size int32, offset int64, hash []byte, weakHash uint32, fromTemporary bool) (RequestResponse, error) { +func (m nativeModel) Request(folder, name string, blockNo, size int32, offset int64, hash []byte, weakHash uint32, fromTemporary bool) (RequestResponse, error) { if strings.Contains(name, `\`) { l.Warnf("Dropping request for %s, contains invalid path separator", name) return nil, ErrNoSuchFile } name = filepath.FromSlash(name) - return m.Model.Request(deviceID, folder, name, blockNo, size, offset, hash, weakHash, fromTemporary) + return m.contextLessModel.Request(folder, name, blockNo, size, offset, hash, weakHash, fromTemporary) } func fixupFiles(files []FileInfo) []FileInfo {