mirror of
https://salsa.debian.org/mdosch/go-sendxmpp
synced 2024-11-18 21:25:31 +00:00
Use human readable file name for private Ox keys.
This commit is contained in:
parent
9c981474da
commit
ae4a727cef
@ -1,6 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## UNRELEASED
|
## UNRELEASED
|
||||||
|
### Changed
|
||||||
|
- Use a human readable file name for private Ox keys.
|
||||||
|
|
||||||
## [v0.8.2] 2024-01-19
|
## [v0.8.2] 2024-01-19
|
||||||
### Changed
|
### Changed
|
||||||
|
11
ox.go
11
ox.go
@ -344,7 +344,16 @@ func oxGetPrivKeyLoc(jid string) (string, error) {
|
|||||||
return strError, fmt.Errorf("oxGetPrivKeyLoc: could not create folder for private keys: %w", err)
|
return strError, fmt.Errorf("oxGetPrivKeyLoc: could not create folder for private keys: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dataFile := dataDir + base64.StdEncoding.EncodeToString([]byte(jid))
|
// TODO: Remove handling of oldDataFile in a later version when it's very likely that there are no
|
||||||
|
// more versions in use using the oldDataFile.
|
||||||
|
oldDataFile := dataDir + base64.StdEncoding.EncodeToString([]byte(jid))
|
||||||
|
dataFile := dataDir + strings.Replace(jid, "@", "_at_", -1)
|
||||||
|
if _, err := os.Stat(oldDataFile); err == nil {
|
||||||
|
err := os.Rename(oldDataFile, dataFile)
|
||||||
|
if err != nil {
|
||||||
|
return dataFile, err
|
||||||
|
}
|
||||||
|
}
|
||||||
return dataFile, nil
|
return dataFile, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user