storage get messages + config improve + tests
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc
2023-02-15 22:08:17 +01:00
parent d9155bac51
commit 6f2a65dac9
8 changed files with 175 additions and 832 deletions

View File

@ -136,6 +136,9 @@ func LoadIdentity(filename string, password string) (*Identity, error) {
}
func (id *Identity) Save() error {
if GetConfig().IdentityFile == "" {
return errors.New("identity filename empty")
}
b, _ := json.Marshal(id)
armor, err := helper.EncryptMessageWithPassword([]byte(GetConfig().memoryPassword), string(b))
if err != nil {