gui, lib: Handle pw adding remote encrypted folder (fixes #7705) (#7772)

This commit is contained in:
Simon Frei
2021-06-17 13:53:02 +02:00
committed by GitHub
parent cb5ef250f4
commit ac2988a485
6 changed files with 165 additions and 111 deletions
+2 -6
View File
@@ -458,13 +458,9 @@ func (cfg *Configuration) FolderMap() map[string]FolderConfiguration {
// folders that have an encryption password set.
func (cfg Configuration) FolderPasswords(device protocol.DeviceID) map[string]string {
res := make(map[string]string, len(cfg.Folders))
nextFolder:
for _, folder := range cfg.Folders {
for _, dev := range folder.Devices {
if dev.DeviceID == device && dev.EncryptionPassword != "" {
res[folder.ID] = dev.EncryptionPassword
continue nextFolder
}
if dev, ok := folder.Device(device); ok && dev.EncryptionPassword != "" {
res[folder.ID] = dev.EncryptionPassword
}
}
return res