Add more information about the folders to ClusterConfig
This commit is contained in:
parent
a323d85d32
commit
9f4cd7716e
@ -1479,9 +1479,21 @@ func (m *Model) clusterConfig(device protocol.DeviceID) protocol.ClusterConfigMe
|
|||||||
|
|
||||||
m.fmut.RLock()
|
m.fmut.RLock()
|
||||||
for _, folder := range m.deviceFolders[device] {
|
for _, folder := range m.deviceFolders[device] {
|
||||||
|
folderCfg := m.cfg.Folders()[folder]
|
||||||
cr := protocol.Folder{
|
cr := protocol.Folder{
|
||||||
ID: folder,
|
ID: folder,
|
||||||
}
|
}
|
||||||
|
var flags uint32
|
||||||
|
if folderCfg.ReadOnly {
|
||||||
|
flags |= protocol.FlagFolderReadOnly
|
||||||
|
}
|
||||||
|
if folderCfg.IgnorePerms {
|
||||||
|
flags |= protocol.FlagFolderIgnorePerms
|
||||||
|
}
|
||||||
|
if folderCfg.IgnoreDelete {
|
||||||
|
flags |= protocol.FlagFolderIgnoreDelete
|
||||||
|
}
|
||||||
|
cr.Flags = flags
|
||||||
for _, device := range m.folderDevices[folder] {
|
for _, device := range m.folderDevices[folder] {
|
||||||
// DeviceID is a value type, but with an underlying array. Copy it
|
// DeviceID is a value type, but with an underlying array. Copy it
|
||||||
// so we don't grab aliases to the same array later on in device[:]
|
// so we don't grab aliases to the same array later on in device[:]
|
||||||
|
|||||||
@ -61,6 +61,13 @@ const (
|
|||||||
FlagRequestTemporary uint32 = 1 << iota
|
FlagRequestTemporary uint32 = 1 << iota
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// ClusterConfigMessage.Folders flags
|
||||||
|
const (
|
||||||
|
FlagFolderReadOnly uint32 = 1 << 0
|
||||||
|
FlagFolderIgnorePerms = 1 << 1
|
||||||
|
FlagFolderIgnoreDelete = 1 << 2
|
||||||
|
)
|
||||||
|
|
||||||
// ClusterConfigMessage.Folders.Devices flags
|
// ClusterConfigMessage.Folders.Devices flags
|
||||||
const (
|
const (
|
||||||
FlagShareTrusted uint32 = 1 << 0
|
FlagShareTrusted uint32 = 1 << 0
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// Copyright (C) 2015 Audrius Butkevicius and Contributors (see the CONTRIBUTORS file).
|
// Copyright (C) 2015 Audrius Butkevicius and Contributors (see the CONTRIBUTORS file).
|
||||||
|
|
||||||
//go:generate -command genxdr go run ../../syncthing/Godeps/_workspace/src/github.com/calmh/xdr/cmd/genxdr/main.go
|
//go:generate -command genxdr go run ../../../Godeps/_workspace/src/github.com/calmh/xdr/cmd/genxdr/main.go
|
||||||
//go:generate genxdr -o packets_xdr.go packets.go
|
//go:generate genxdr -o packets_xdr.go packets.go
|
||||||
|
|
||||||
package protocol
|
package protocol
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user