mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
naming convention -> screen size.
This commit is contained in:
parent
227b6b24c2
commit
99068b893b
@ -109,13 +109,13 @@ func (h *MessageHandlerCtx) Message(session types.Session, raw []byte) error {
|
||||
|
||||
// Screen Events
|
||||
case event.SCREEN_RESOLUTION:
|
||||
err = h.screenResolution(session)
|
||||
err = h.screenSize(session)
|
||||
case event.SCREEN_CONFIGURATIONS:
|
||||
err = h.screenConfigurations(session)
|
||||
case event.SCREEN_SET:
|
||||
payload := &message.ScreenResolution{}
|
||||
err = utils.Unmarshal(payload, raw, func() error {
|
||||
return h.screenSet(session, payload)
|
||||
return h.screenSizeChange(session, payload)
|
||||
})
|
||||
|
||||
// Boradcast Events
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"demodesk/neko/internal/types/message"
|
||||
)
|
||||
|
||||
func (h *MessageHandlerCtx) screenSet(session types.Session, payload *message.ScreenResolution) error {
|
||||
func (h *MessageHandlerCtx) screenSizeChange(session types.Session, payload *message.ScreenResolution) error {
|
||||
if !session.Admin() {
|
||||
h.logger.Debug().Msg("user not admin")
|
||||
return nil
|
||||
@ -27,7 +27,7 @@ func (h *MessageHandlerCtx) screenSet(session types.Session, payload *message.Sc
|
||||
}, nil)
|
||||
}
|
||||
|
||||
func (h *MessageHandlerCtx) screenResolution(session types.Session) error {
|
||||
func (h *MessageHandlerCtx) screenSize(session types.Session) error {
|
||||
size := h.desktop.GetScreenSize()
|
||||
if size == nil {
|
||||
h.logger.Debug().Msg("could not get screen size")
|
||||
|
@ -47,8 +47,8 @@ func (h *MessageHandlerCtx) SessionConnected(session types.Session) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// send current screen resolution
|
||||
if err := h.screenResolution(session); err != nil {
|
||||
// send current screen size
|
||||
if err := h.screenSize(session); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user