lib/model, lib/config: Support "live" device removal, folder unsharing and folder configuration changes
Furthermore: 1. Cleans configs received, migrates them as we receive them. 2. Clears indexes of devices we no longer share the folder with GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3478
This commit is contained in:
@@ -290,6 +290,18 @@ func (s *FileSet) MtimeFS() *fs.MtimeFS {
|
||||
return fs.NewMtimeFS(kv)
|
||||
}
|
||||
|
||||
func (s *FileSet) ListDevices() []protocol.DeviceID {
|
||||
s.updateMutex.Lock()
|
||||
devices := make([]protocol.DeviceID, 0, len(s.remoteSequence))
|
||||
for id, seq := range s.remoteSequence {
|
||||
if seq > 0 {
|
||||
devices = append(devices, id)
|
||||
}
|
||||
}
|
||||
s.updateMutex.Unlock()
|
||||
return devices
|
||||
}
|
||||
|
||||
// maxSequence returns the highest of the Sequence numbers found in
|
||||
// the given slice of FileInfos. This should really be the Sequence of
|
||||
// the last item, but Syncthing v0.14.0 and other implementations may not
|
||||
|
||||
Reference in New Issue
Block a user