summaryrefslogtreecommitdiff
path: root/server/user/user.go
diff options
context:
space:
mode:
authorraven <citrons@mondecitronne.com>2026-02-10 17:33:13 -0600
committerraven <citrons@mondecitronne.com>2026-02-10 17:33:13 -0600
commite888f268c87ca1d3b4d6b9a1a64b9506bc94bb53 (patch)
tree5f5289b0c340aca15667e3333aa8653eaebe263a /server/user/user.go
parent64900975d5cd90910830dae3f1e5596f1ce2d1a3 (diff)
reorganize anonymous user handling
Diffstat (limited to 'server/user/user.go')
-rw-r--r--server/user/user.go26
1 files changed, 2 insertions, 24 deletions
diff --git a/server/user/user.go b/server/user/user.go
index 198fc0f..18d9383 100644
--- a/server/user/user.go
+++ b/server/user/user.go
@@ -66,30 +66,6 @@ func (us *UserKind) ByName(name string) *User {
}
}
-func (us *UserKind) DeleteAnonUsers() {
- var anon []string
- err := us.db.View(func(tx *bolt.Tx) error {
- bucket := tx.Bucket([]byte("anonymous users"))
- if bucket == nil {
- return nil
- }
- bucket.ForEach(func(k, v []byte) error {
- anon = append(anon, string(k))
- return nil
- })
- return nil
- })
- if err != nil {
- log.Fatal("error reading database: ", err)
- }
- for _, id := range anon {
- switch u := us.world.GetObject(id).(type) {
- case *User:
- u.Delete()
- }
- }
-}
-
func (us *UserKind) Undata(o proto.Object) object.Object {
var u User
u.kind = us
@@ -167,6 +143,8 @@ func (u *User) Delete() {
channels.DeleteBucket([]byte(u.id))
auth, _ := tx.CreateBucketIfNotExists([]byte("auth"))
auth.DeleteBucket([]byte(u.id))
+ udata, _ := tx.CreateBucketIfNotExists([]byte("user data"))
+ udata.DeleteBucket([]byte(u.id))
return nil
})
if err != nil {