diff options
| author | citrons <citrons@mondecitronne.com> | 2025-06-12 15:19:56 -0500 |
|---|---|---|
| committer | citrons <citrons@mondecitronne.com> | 2025-06-12 15:24:48 -0500 |
| commit | 6e9496323fbdfbe2b60122ce68cf3791ccb2910d (patch) | |
| tree | e9e88b894b56441b1b5591f626c776224dc0669c /server/user/user.go | |
| parent | ececa97d9ee6a435f81756bc25e25ed80285d20b (diff) | |
object.Tombstone
Diffstat (limited to 'server/user/user.go')
| -rw-r--r-- | server/user/user.go | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/server/user/user.go b/server/user/user.go index fb1022f..17063b4 100644 --- a/server/user/user.go +++ b/server/user/user.go @@ -10,7 +10,6 @@ import ( type UserStore struct { world *object.World byName map[string]*User - gone map[string]Tombstone } type User struct { @@ -24,14 +23,8 @@ type User struct { Anonymous bool } -type Tombstone struct { - name string -} - func NewStore(world *object.World) *UserStore { - return &UserStore { - world, make(map[string]*User), make(map[string]Tombstone), - } + return &UserStore {world, make(map[string]*User)} } func (us *UserStore) CreateUser(name string) (*User, *proto.Fail) { @@ -94,8 +87,9 @@ func (u *User) Delete() { delete(u.store.byName, validate.Fold(u.name)) u.store.world.RemoveObject(u.id) - gone := Tombstone {u.name} - u.store.gone[u.id] = gone + gone := object.Tombstone { + u.id, map[string]string {"": u.name, "kind": "u"}, + } u.store.world.PutObject(u.id, gone) } @@ -111,9 +105,3 @@ func (u *User) InfoFor(uid string) proto.Object { } return proto.Object {"u", u.id, i} } - -func (t Tombstone) GetInfo() proto.Object { - return proto.Object { - "gone", "", map[string]string {"": t.name, "kind": "u"}, - } -} |
