lib/model: Add option for overwriting names on connect (fixes #2912)
This commit is contained in:
committed by
Jakob Borg
parent
2eb8a9ef56
commit
4389bb037d
@@ -1007,7 +1007,7 @@ func (m *Model) AddConnection(conn Connection, hello protocol.HelloMessage) {
|
||||
l.Infof(`Device %s client is "%s %s" named "%s"`, deviceID, hello.ClientName, hello.ClientVersion, hello.DeviceName)
|
||||
|
||||
device, ok := m.cfg.Devices()[deviceID]
|
||||
if ok && device.Name == "" {
|
||||
if ok && (device.Name == "" || m.cfg.Options().OverwriteNames) {
|
||||
device.Name = hello.DeviceName
|
||||
m.cfg.SetDevice(device)
|
||||
m.cfg.Save()
|
||||
|
||||
Reference in New Issue
Block a user