add session to host change.

This commit is contained in:
Miroslav Šedivý
2024-05-06 23:47:13 +02:00
parent b562c797b3
commit 416faa3df4
9 changed files with 46 additions and 46 deletions

View File

@ -116,6 +116,7 @@ type SessionCursors struct {
/////////////////////////////
type ControlHost struct {
ID string `json:"id"`
HasHost bool `json:"has_host"`
HostID string `json:"host_id,omitempty"`
}

View File

@ -57,6 +57,9 @@ type Session interface {
Profile() MemberProfile
State() SessionState
IsHost() bool
SetAsHost()
SetAsHostBy(session Session)
ClearHost()
PrivateModeEnabled() bool
// cursor
@ -83,9 +86,7 @@ type SessionManager interface {
List() []Session
Range(func(Session) bool)
SetHost(host Session)
GetHost() (Session, bool)
ClearHost()
SetCursor(cursor Cursor, session Session)
PopCursors() map[Session][]Cursor
@ -100,7 +101,7 @@ type SessionManager interface {
OnDisconnected(listener func(session Session))
OnProfileChanged(listener func(session Session))
OnStateChanged(listener func(session Session))
OnHostChanged(listener func(session Session))
OnHostChanged(listener func(session, host Session))
OnSettingsChanged(listener func(session Session, new Settings, old Settings))
UpdateSettingsFunc(session Session, f func(settings *Settings) bool)