From 6e9496323fbdfbe2b60122ce68cf3791ccb2910d Mon Sep 17 00:00:00 2001 From: citrons Date: Thu, 12 Jun 2025 15:19:56 -0500 Subject: object.Tombstone --- server/channel/channel.go | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'server/channel/channel.go') diff --git a/server/channel/channel.go b/server/channel/channel.go index 6ef21ba..3cb6f60 100644 --- a/server/channel/channel.go +++ b/server/channel/channel.go @@ -14,7 +14,6 @@ type ChannelStore struct { world *object.World byName map[string]*Channel directChannels map[string]*Channel - deleted map[string]Tombstone } type Channel struct { @@ -29,14 +28,9 @@ type Channel struct { Stream session.Stream } -type Tombstone struct { - name string -} - func NewStore(world *object.World) *ChannelStore { return &ChannelStore { world, make(map[string]*Channel), make(map[string]*Channel), - make(map[string]Tombstone), } } @@ -209,8 +203,9 @@ func (c *Channel) Delete() { delete(c.store.byName, validate.Fold(c.name)) c.store.world.RemoveObject(c.id) - deleted := Tombstone {c.name} - c.store.deleted[c.id] = deleted + deleted := object.Tombstone { + c.id, map[string]string {"": c.name, "kind": c.Kind()}, + } c.store.world.PutObject(c.id, deleted) } @@ -228,9 +223,3 @@ func (c *Channel) InfoFor(uid string) proto.Object { c.Kind(), c.id, map[string]string {"": c.NameFor(uid)}, } } - -func (t Tombstone) GetInfo() proto.Object { - return proto.Object { - "gone", "", map[string]string {"": t.name, "kind": "channel"}, - } -} -- cgit v1.2.3