func (r *Room) Close() {
	r.closeOnce.Do(func() {
		r.closed = true
		r.Members.Each(func(_ string, item set.Item) error {
			item.Value().(*Member).Close()
			return nil
		})
		r.Members.Clear()
		close(r.broadcast)
	})
}
Close the room and all the users it contains.
package chat
import (
	"errors"
	"fmt"
	"io"
	"sort"
	"sync"
	"github.com/shazow/ssh-chat/chat/message"
	"github.com/shazow/ssh-chat/internal/humantime"
	"github.com/shazow/ssh-chat/set"
)
const historyLen = 20
const roomBuffer = 10
var ErrRoomClosed = errors.New("room closed")
var ErrInvalidName = errors.New("invalid name")
type Member struct {
	*message.User
	IsOp bool
	mu      sync.Mutex
	isMuted bool  
}
func (m *Member) IsMuted() bool {
	m.mu.Lock()
	defer m.mu.Unlock()
	return m.isMuted
}
func (m *Member) SetMute(muted bool) {
	m.mu.Lock()
	defer m.mu.Unlock()
	m.isMuted = muted
}
type Room struct {
	topic     string
	history   *message.History
	broadcast chan message.Message
	commands  Commands
	closed    bool
	closeOnce sync.Once
	Members *set.Set
}
func NewRoom() *Room {
	broadcast := make(chan message.Message, roomBuffer)
	return &Room{
		broadcast: broadcast,
		history:   message.NewHistory(historyLen),
		commands:  *defaultCommands,
		Members: set.New(),
	}
}
func (r *Room) SetCommands(commands Commands) {
	r.commands = commands
}