From ec8924d05ace98dbc094b3833b6b87167bfad1ce Mon Sep 17 00:00:00 2001 From: ycc Date: Wed, 5 Jun 2024 23:18:25 +0200 Subject: [PATCH] save peer status when db created or last message when received --- client/messagestorage.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/messagestorage.go b/client/messagestorage.go index ba5a11e..83de46a 100644 --- a/client/messagestorage.go +++ b/client/messagestorage.go @@ -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 }