save peer status when db created or last message when received
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc 2024-06-05 23:18:25 +02:00
parent d2bd4deb82
commit ec8924d05a

View File

@ -22,7 +22,7 @@ func StoreMessage(peer *Peer, usermessage *meowlib.UserMessage, filenames []stri
dbid = uuid.NewString()
peer.DbIds = []string{dbid}
identity.Save()
identity.Peers.StorePeer(peer)
identity.CreateFolder()
file, err := os.Create(filepath.Join(cfg.StoragePath, identity.Uuid, dbid+GetConfig().DbSuffix))
if err != nil {
@ -95,7 +95,7 @@ func StoreMessage(peer *Peer, usermessage *meowlib.UserMessage, filenames []stri
}
ium := DbMessageToInternalUserMessage(id, dbid, dbm)
peer.LastMessage = ium
identity.Save()
identity.Peers.StorePeer(peer)
return nil
}