gui, lib/config, lib/model: Add ability to ignore folders offered by other nodes (fixes #3993)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4179
LGTM: AudriusButkevicius, calmh
This commit is contained in:
nrm21
2017-05-31 18:04:00 +00:00
committed by Jakob Borg
parent 3959eb26fb
commit b49bbe82dd
6 changed files with 36 additions and 0 deletions

View File

@@ -321,6 +321,19 @@ func (w *Wrapper) IgnoredDevice(id protocol.DeviceID) bool {
return false
}
// IgnoredFolder returns whether or not share attempts for the given
// folder should be silently ignored.
func (w *Wrapper) IgnoredFolder(folder string) bool {
w.mut.Lock()
defer w.mut.Unlock()
for _, nfolder := range w.cfg.IgnoredFolders {
if folder == nfolder {
return true
}
}
return false
}
// Device returns the configuration for the given device and an "ok" bool.
func (w *Wrapper) Device(id protocol.DeviceID) (DeviceConfiguration, bool) {
w.mut.Lock()