@@ 55,12 55,6 @@ func saveStorer(storer *mautrix.InMemoryStore, user id.UserID) error {
return err
}
- nb := storer.LoadNextBatch(user)
- err = os.WriteFile(filepath.Join(dir, "next_batch"), []byte(nb), 0600)
- if err != nil {
- return err
- }
-
var rooms bytes.Buffer
err = gob.NewEncoder(&rooms).Encode(storer.Rooms)
if err != nil {
@@ 70,7 64,9 @@ func saveStorer(storer *mautrix.InMemoryStore, user id.UserID) error {
if err != nil {
return err
}
- return nil
+
+ nb := storer.LoadNextBatch(user)
+ return os.WriteFile(filepath.Join(dir, "next_batch"), []byte(nb), 0600)
}
func loadDirectChats(user id.UserID) (map[id.RoomID]id.UserID, error) {