storage start and identity in shared config

This commit is contained in:
ycc
2023-01-07 00:39:05 +01:00
parent 52ae52ca9f
commit 5ac92ce3a8
7 changed files with 112 additions and 11 deletions

View File

@ -32,6 +32,7 @@ func CreateIdentity(nickname string) *Identity {
var id Identity
id.Nickname = nickname
id.RootKp = meowlib.NewKeyPair()
GetConfig().me = &id
return &id
}
@ -124,6 +125,7 @@ func LoadIdentity(filename string, password string) (*Identity, error) {
return nil, err
}
err = json.Unmarshal([]byte(pass), &id)
GetConfig().me = &id
return &id, err
}