diff --git a/daemon.go b/daemon.go index e56b7b5..238b7c8 100644 --- a/daemon.go +++ b/daemon.go @@ -308,6 +308,14 @@ func Processor(events chan ClientEvent, finished chan struct{}) { } } } + for rn, r := range rooms { + if *statedir == "" && len(r.members) == 0 { + log.Println(rn, "emptied room") + delete(rooms, rn) + close(roomSinks[r]) + delete(roomSinks, r) + } + } case EventTerm: for _, sink := range roomSinks { sink <- ClientEvent{eventType: EventTerm}