replace old Member structures.

This commit is contained in:
Miroslav Šedivý 2020-12-01 19:47:50 +01:00
parent 6599a093c0
commit b82fbae597
2 changed files with 6 additions and 22 deletions

View File

@ -48,13 +48,11 @@ type SignalAnswer struct {
// Member
/////////////////////////////
// TODO: New.
type MemberID struct {
Event string `json:"event,omitempty"`
ID string `json:"id"`
}
// TODO: New.
type MemberData struct {
Event string `json:"event,omitempty"`
ID string `json:"id"`
@ -137,17 +135,3 @@ type BroadcastStatus struct {
IsActive bool `json:"is_active"`
URL string `json:"url,omitempty"`
}
// TODO: Remove.
type Member struct {
Event string `json:"event"`
ID string `json:"id"`
Name string `json:"name"`
Admin bool `json:"admin"`
}
// TODO: Remove.
type MemberDisconnected struct {
Event string `json:"event"`
ID string `json:"id"`
}

View File

@ -19,11 +19,11 @@ func (h *MessageHandlerCtx) SessionConnected(session types.Session) error {
// let everyone know there is a new session
h.sessions.Broadcast(
message.Member{
Event: event.MEMBER_CONNECTED,
ID: session.ID(),
Name: session.Name(),
Admin: session.Admin(),
message.MemberData{
Event: event.MEMBER_CONNECTED,
ID: session.ID(),
Name: session.Name(),
IsAdmin: session.Admin(),
}, nil)
return nil
@ -43,7 +43,7 @@ func (h *MessageHandlerCtx) SessionDisconnected(session types.Session) error {
// let everyone know session disconnected
h.sessions.Broadcast(
message.MemberDisconnected{
message.MemberID{
Event: event.MEMBER_DISCONNECTED,
ID: session.ID(),
}, nil);