summaryrefslogtreecommitdiff
path: root/daemon.go
diff options
context:
space:
mode:
Diffstat (limited to 'daemon.go')
-rw-r--r--daemon.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/daemon.go b/daemon.go
index 3afda4f..0896add 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}