X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fsyncthing%2Fstfolder.go;h=2ad6859ac792557bb9f1b07a01750834938b8caa;hb=90992bcc039d2b982ad6df18cf3188b53f939368;hp=d5c74ef00b0facacc2d502f8a577d32569e59fe1;hpb=d917dcca04b8d5f5a7a4fdf82d0a66ef14611fca;p=src%2Fxds%2Fxds-agent.git diff --git a/lib/syncthing/stfolder.go b/lib/syncthing/stfolder.go index d5c74ef..2ad6859 100644 --- a/lib/syncthing/stfolder.go +++ b/lib/syncthing/stfolder.go @@ -72,16 +72,17 @@ func (s *SyncThing) FolderChange(f FolderChangeArg) (string, error) { return "", err } + stClientID := f.SyncThingID // Add new Device if needed var devID protocol.DeviceID - if err := devID.UnmarshalText([]byte(f.SyncThingID)); err != nil { + if err := devID.UnmarshalText([]byte(stClientID)); err != nil { s.log.Errorf("not a valid device id (err %v)", err) return "", err } newDevice := stconfig.DeviceConfiguration{ DeviceID: devID, - Name: f.SyncThingID, + Name: stClientID, Addresses: []string{"dynamic"}, } @@ -102,7 +103,7 @@ func (s *SyncThing) FolderChange(f FolderChangeArg) (string, error) { label = strings.Split(id, "/")[0] } if id = f.ID; id == "" { - id = f.SyncThingID[0:15] + "_" + label + id = stClientID[0:15] + "_" + label } // Resolve local path