From 3227978725ed5e79eec99b25df39f176ca0aa770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Wed, 14 Jul 2021 14:23:51 +0200 Subject: [PATCH] add screencast enabled bool to system init. --- internal/types/message/messages.go | 15 ++++++++------- internal/websocket/handler/system.go | 5 +++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/types/message/messages.go b/internal/types/message/messages.go index d1a6356e..d40f9af4 100644 --- a/internal/types/message/messages.go +++ b/internal/types/message/messages.go @@ -21,13 +21,14 @@ type SystemWebRTC struct { } type SystemInit struct { - Event string `json:"event,omitempty"` - SessionId string `json:"session_id"` - ControlHost ControlHost `json:"control_host"` - ScreenSize ScreenSize `json:"screen_size"` - Sessions map[string]SessionData `json:"sessions"` - ImplicitHosting bool `json:"implicit_hosting"` - WebRTC SystemWebRTC `json:"webrtc"` + Event string `json:"event,omitempty"` + SessionId string `json:"session_id"` + ControlHost ControlHost `json:"control_host"` + ScreenSize ScreenSize `json:"screen_size"` + Sessions map[string]SessionData `json:"sessions"` + ImplicitHosting bool `json:"implicit_hosting"` + ScreencastEnabled bool `json:"screencast_enabled"` + WebRTC SystemWebRTC `json:"webrtc"` } type SystemAdmin struct { diff --git a/internal/websocket/handler/system.go b/internal/websocket/handler/system.go index 553a0776..59c2a63a 100644 --- a/internal/websocket/handler/system.go +++ b/internal/websocket/handler/system.go @@ -43,8 +43,9 @@ func (h *MessageHandlerCtx) systemInit(session types.Session) error { Height: size.Height, Rate: size.Rate, }, - Sessions: sessions, - ImplicitHosting: h.sessions.ImplicitHosting(), + Sessions: sessions, + ImplicitHosting: h.sessions.ImplicitHosting(), + ScreencastEnabled: h.capture.Screencast().Enabled(), WebRTC: message.SystemWebRTC{ Videos: h.capture.VideoIDs(), },