From d5c778e721e26a441c95915fa3feb744ac4d7031 Mon Sep 17 00:00:00 2001 From: raven Date: Mon, 20 Oct 2025 18:24:28 -0500 Subject: track user channels --- server/user/user.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server/user') diff --git a/server/user/user.go b/server/user/user.go index 46eda35..7f272c1 100644 --- a/server/user/user.go +++ b/server/user/user.go @@ -22,7 +22,6 @@ type User struct { description string Stream session.Stream anonymous bool - Channels map[string]bool // TODO: remove } func Kind(world *object.World) *UserKind { @@ -45,7 +44,6 @@ func (us *UserKind) CreateUser(name string) (*User, *proto.Fail) { u.name = name u.id = proto.GenId() u.anonymous = true - u.Channels = make(map[string]bool) u.Save() return &u, nil } @@ -154,8 +152,10 @@ func (u *User) Delete() { } u.kind.world.PutObject(u.id, gone) err := u.kind.db.Update(func(tx *bolt.Tx) error { - bucket, _ := tx.CreateBucketIfNotExists([]byte("anonymous users")) - bucket.Delete([]byte(u.id)) + anons, _ := tx.CreateBucketIfNotExists([]byte("anonymous users")) + anons.Delete([]byte(u.id)) + channels, _ := tx.CreateBucketIfNotExists([]byte("user channels")) + channels.DeleteBucket([]byte(u.id)) return nil }) if err != nil { -- cgit v1.2.3