beautify.

This commit is contained in:
Miroslav Šedivý 2020-12-02 17:23:35 +01:00
parent 82d37b15e4
commit 220e162f42

View File

@ -97,6 +97,7 @@ func (manager *SessionManagerCtx) Delete(id string) error {
// ---
// host
// ---
func (manager *SessionManagerCtx) HasHost() bool {
manager.hostMu.Lock()
defer manager.hostMu.Unlock()
@ -131,6 +132,7 @@ func (manager *SessionManagerCtx) ClearHost() {
// ---
// members list
// ---
func (manager *SessionManagerCtx) HasConnectedMembers() bool {
manager.membersMu.Lock()
defer manager.membersMu.Unlock()
@ -201,6 +203,7 @@ func (manager *SessionManagerCtx) AdminBroadcast(v interface{}, exclude interfac
// ---
// events
// ---
func (manager *SessionManagerCtx) OnHost(listener func(session types.Session)) {
manager.emmiter.On("host", func(payload ...interface{}) {
listener(payload[0].(*SessionCtx))
@ -235,6 +238,10 @@ func (manager *SessionManagerCtx) OnDisconnected(listener func(session types.Ses
})
}
// ---
// config
// ---
func (manager *SessionManagerCtx) ImplicitHosting() bool {
return manager.config.ImplicitHosting
}