mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
event SystemDisconnect.
This commit is contained in:
parent
21293256ed
commit
1b6bc44f2a
@ -84,7 +84,7 @@ func (session *SessionCtx) SetWebRTCConnected(connected bool) {
|
|||||||
|
|
||||||
func (session *SessionCtx) Disconnect(reason string) error {
|
func (session *SessionCtx) Disconnect(reason string) error {
|
||||||
if err := session.Send(
|
if err := session.Send(
|
||||||
message.Disconnect{
|
message.SystemDisconnect{
|
||||||
Event: event.SYSTEM_DISCONNECT,
|
Event: event.SYSTEM_DISCONNECT,
|
||||||
Message: reason,
|
Message: reason,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
@ -23,7 +23,6 @@ type SystemAdmin struct {
|
|||||||
BroadcastStatus BroadcastStatus `json:"broadcast_status"`
|
BroadcastStatus BroadcastStatus `json:"broadcast_status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: New.
|
|
||||||
type SystemDisconnect struct {
|
type SystemDisconnect struct {
|
||||||
Event string `json:"event,omitempty"`
|
Event string `json:"event,omitempty"`
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
@ -139,11 +138,6 @@ type BroadcastStatus struct {
|
|||||||
URL string `json:"url,omitempty"`
|
URL string `json:"url,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Remove.
|
|
||||||
type Disconnect struct {
|
|
||||||
Event string `json:"event"`
|
|
||||||
Message string `json:"message"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Remove.
|
// TODO: Remove.
|
||||||
type MembersList struct {
|
type MembersList struct {
|
||||||
|
@ -124,7 +124,8 @@ func (ws *WebSocketManagerCtx) Upgrade(w http.ResponseWriter, r *http.Request) e
|
|||||||
ws.logger.Warn().Err(err).Msg("authentication failed")
|
ws.logger.Warn().Err(err).Msg("authentication failed")
|
||||||
|
|
||||||
// TODO: Refactor
|
// TODO: Refactor
|
||||||
if err = connection.WriteJSON(message.Disconnect{
|
if err = connection.WriteJSON(
|
||||||
|
message.SystemDisconnect{
|
||||||
Event: event.SYSTEM_DISCONNECT,
|
Event: event.SYSTEM_DISCONNECT,
|
||||||
Message: "authentication failed",
|
Message: "authentication failed",
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user