diff --git a/internal/types/event/events.go b/internal/types/event/events.go index 58e27168..94574dce 100644 --- a/internal/types/event/events.go +++ b/internal/types/event/events.go @@ -15,8 +15,6 @@ const ( const ( MEMBER_CREATED = "member/created" MEMBER_DELETED = "member/deleted" - MEMBER_CONNECTED = "member/connected" - MEMBER_DISCONNECTED = "member/disconnected" MEMBER_PROFILE = "member/profile" MEMBER_STATE = "member/state" ) diff --git a/internal/websocket/handler/session.go b/internal/websocket/handler/session.go index 39070b80..9dd36775 100644 --- a/internal/websocket/handler/session.go +++ b/internal/websocket/handler/session.go @@ -56,13 +56,7 @@ func (h *MessageHandlerCtx) SessionConnected(session types.Session) error { } } - h.sessions.Broadcast( - message.MemberID{ - Event: event.MEMBER_CONNECTED, - ID: session.ID(), - }, nil); - - return nil + return h.SessionStateChanged(session) } func (h *MessageHandlerCtx) SessionDisconnected(session types.Session) error { @@ -83,13 +77,7 @@ func (h *MessageHandlerCtx) SessionDisconnected(session types.Session) error { }, nil) } - h.sessions.Broadcast( - message.MemberID{ - Event: event.MEMBER_DISCONNECTED, - ID: session.ID(), - }, nil); - - return nil + return h.SessionStateChanged(session) } func (h *MessageHandlerCtx) SessionProfileChanged(session types.Session) error {