summaryrefslogtreecommitdiff
path: root/server/user/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/user/user.go')
-rw-r--r--server/user/user.go8
1 files changed, 4 insertions, 4 deletions
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 {