New device, folder prompts (fixes #120, fixes #330)

This commit is contained in:
Audrius Butkevicius
2014-12-27 23:12:12 +00:00
parent 9a946eed80
commit 56ccb5b2ab
8 changed files with 194 additions and 23 deletions

View File

@@ -245,6 +245,19 @@ func (w *Wrapper) InvalidateFolder(id string, err string) {
}
}
// Returns whether or not connection attempts from the given device should be
// silently ignored.
func (w *Wrapper) IgnoredDevice(id protocol.DeviceID) bool {
w.mut.Lock()
defer w.mut.Unlock()
for _, device := range w.cfg.IgnoredDevices {
if device == id {
return true
}
}
return false
}
// Save writes the configuration to disk, and generates a ConfigSaved event.
func (w *Wrapper) Save() error {
fd, err := ioutil.TempFile(filepath.Dir(w.path), "cfg")