store fix + add peer invitationPending Check
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc
2024-02-25 20:15:35 +01:00
parent c4b61e16c5
commit 4b3d7548bd
5 changed files with 21 additions and 4 deletions

View File

@ -18,6 +18,8 @@ func StoreMessage(peer *Peer, usermessage *meowlib.UserMessage, password string)
// TODO : if file size > X new db
if len(peer.DbIds) == 0 {
dbid = uuid.NewString()
peer.DbIds = []string{dbid}
GetConfig().me.Save()
file, err := os.Create(filepath.Join(GetConfig().StoragePath, dbid+GetConfig().DbSuffix))
if err != nil {
return err
@ -30,7 +32,6 @@ func StoreMessage(peer *Peer, usermessage *meowlib.UserMessage, password string)
return err
}
sqliteDatabase.Close()
GetConfig().me.Save()
} else {
dbid = peer.DbIds[len(peer.DbIds)-1]
}